Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Net.ServicePointManager Setting TSL's 1

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US
Had a webservice I was consuming throw an error:
-----------------
An error occurred while making the HTTP request to This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.
-------------------
The webservice webmaster stated they had upgraded to TSL1.2 over the weekend.

The cure is to set the TSL protocol in my code behind.

System.Net.ServicePointManager.SecurityProtocol = Net.SecurityProtocolType.Tls12

This works. I saw some examples online where it stated I could add a pipe between protocols like this

Code:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;


Problem is it didn't/doesn't like the pipes. "|"

Has anyone had any success adding multiple Protocols.

Thanks
-dan
 
That is C# syntax you are trying to use. You need to put ORs between them
 
HA HA Gee do I feel dumb.

Thank you JB. Appreciate it.
 
nope, don't feel dumb. Just remember that when you google for answers most of them will be C# samples unless you specifically look for VB examples.
I just usually look for the first few find an answer and convert the code if necessary. Here is a good online converter if you ever need to use it:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top