title: ASP.NET "The request was aborted: Could not create SSL/TLS secure channel" occurs also with configured servicepointmanager
body: <p>I'm trying to request this image: <a href="https://www.kamerstunt.nl/file/img/web/woning/9577323WenumWieselZwolseweg-142d_6.jpg" rel="nofollow noreferrer">https://www.kamerstunt.nl/file/img/web/woning/9577323WenumWieselZwolseweg-142d_6.jpg</a>
  If the image no longer exists when you read this, it might have been removed, but you'd still be able to view the SSL certificate in question. Using my browser I was able to successfully navigate to the page, request the image and see a valid SSL certificate.</p>
  
  <p>I checked here: <a href="https://stackoverflow.com/questions/10822509/the-request-was-aborted-could-not-create-ssl-tls-secure-channel">The request was aborted: Could not create SSL/TLS secure channel</a></p>
  
  <p>So I added that solution to my code:</p>
  
  <pre><code>Dim imgRequest As WebRequest = WebRequest.Create("https://www.kamerstunt.nl/file/img/web/woning/9577323WenumWieselZwolseweg-142d_6.jpg")
  Dim imgResponse As WebResponse
  ServicePointManager.Expect100Continue = True
  ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls 
  '//I also tried: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or SecurityProtocolType.Ssl3
  imgResponse = imgRequest.GetResponse()
  Dim streamPhoto As Stream = imgResponse.GetResponseStream()
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
  </code></pre>
  
  <p>But then I get errors:
  <code>'Tls12' is not a member of 'System.Net.SecurityProtocolType'</code> and 
  <code>'Tls11' is not a member of 'System.Net.SecurityProtocolType'</code></p>
  
  <p>I also tried to change the registry to allow windows to not block DHE with 512 bits and added ClientMinKeyBitLength with 0x00000200(512) value under <code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\KeyExchangeAlgorithms\Diffie-Hellman.</code>  </p>
  
  <p>But still it fails...why?</p>