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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -