The request was aborted: Could not create SSL/TLS secure channel for HttpWebRequest

I am using an asmx webservice client to connect to a backend web service and we have multiple environments .In one of the server ,am getting error “The request was aborted: Could not create SSL/TLS secure channel” but every other environments it works fine. I referred below articles already and none of it helped.

The request was aborted: Could not create SSL/TLS secure channel.

The request was aborted: Could not create SSL/TLS secure

HttpWebRequest: The request was aborted: Could not create SSL/TLS secure channel

HttpWebRequest The request was aborted: Could not create SSL/TLS secure channel

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

If the issue is server specific ,you may be running into any issue
with Server Certification validation check (because of the Root
Certificate missing) or CRL check failure ,then following code might
help.Add this to your project and verify

ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, errors) => true;

Please note that this is not a good way as we are just making all the ServerCertificateValidation always true .

If server validation is the issue,the correct way to do is to make sure your you can successfully access the https url from the machine.You can browse to the URL using any browser and it should be successfully be able to browse without any warning.if any warning comes(e.g. certificate not trusted),verify the error and make sure you have the required root certificate installed etc

Hope this helps!


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x