I'm trying to request this image: https://www.kamerstunt.nl/file/img/web/woning/9577323WenumWieselZwolseweg-142d_6.jpg 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.
I checked here: The request was aborted: Could not create SSL/TLS secure channel
So I added that solution to my 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()
I tried:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 Or SecurityProtocolType.Tls Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
But then I get errors:
'Tls12' is not a member of 'System.Net.SecurityProtocolType'
and
'Tls11' is not a member of 'System.Net.SecurityProtocolType'
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 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\KeyExchangeAlgorithms\Diffie-Hellman.
But still it fails...why?