"Fetch a URL" scheduled task on Plesk for Windows server does not work properly after disabling TLS 1.0




  • Avatar

    This patch did not work for me, it gave me another error; however, it led me to the correct update in this file. 

    The error that I was receiving was: Method invocation failed because [System.Net.SecurityProtocolType] does not contain a method named 'op_Addition'.

    After some quick research, I found that this is because the file was trying to add a value to a single value property.  And, there is a different way to prep powershell to use the other TLS options, so here is what I had to do to file.

    First, I had to update/comment out these lines:

    #if ([Net.ServicePointManager]::SecurityProtocol -notcontains 'Tls12') {
    #[Net.ServicePointManager]::SecurityProtocol += [Net.SecurityProtocolType]::Tls12

    instead, I had to add this line (the commented line has the url for the website that I found this solution at:

    # https://blog.darrenjrobinson.com/powershell-the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-send/
    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12

    Comment actions Permalink
  • Avatar
    Nick Plekhov


    Thank you for bringing our attention to this.
    The solution provided by you allows all TLS versions including 1.0 and 1.1.
    Usually, TLS 1.0 disabled for a reason and enabling it back may be treated as a security violation.

    Instead, I added the following line:
    [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
    This explicitly forces the script to use TLS1.2

    I have updated the article.

    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request