Quick & Useful Snippet to Set SSL TLS Protocol of PowerShell

  $requiredTls='Tls12'
  $availableSslProtocols=[enum]::getnames([net.securityprotocoltype])
  if([Net.ServicePointManager]::SecurityProtocol -notin $requiredTls -and $requiredTls -in $availableSslProtocols){
      [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::$requiredTls
  }

Leave a Reply

Your email address will not be published. Required fields are marked *