vb.net - .NET and ServicePointManager.SecurityProtocol -


i'm using webclient class in .net , went download site.

dim owebclient new webclient() dim odownloadedpage string = owebclient.downloadstring(<site>) 

it tossed authentication error after little searching turned out site trying download must of disabled tls1.0

so changed servicepointmanger this

servicepointmanager.securityprotocol = securityprotocoltype.ssl3 or     securityprotocoltype.tls12 or securityprotocoltype.tls11 or securityprotocoltype.tls 

i got same error.. decided change this..

servicepointmanager.securityprotocol = securityprotocoltype.ssl3 or     securityprotocoltype.tls or securityprotocoltype.tls11 or securityprotocoltype.tls12 

see did there? switched order , worked.

can explain me difference in ordering? , why matters? i'm wondering if go download tls 1.0 site, if fail.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -