For this issue, you can add the following code at the beginning :
// using System.Net;
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Use SecurityProtocolType.Ssl3 if needed for compatibility reasons
If you are getting this problem while configuring PayPal, please note that they won't support SSL3 starting by December, 3rd 2018. You'll need to use TLS.
Contributor
2613 Points
2719 Posts
Could not create SSL/TLS secure channel
Sep 10, 2019 08:12 PM|wavemaster|LINK
I am doing an integration with PayPal from my Razor C WebPages application.
HttpWebRequest ppReq = (HttpWebRequest)WebRequest.Create(url); ppReq.Method = "POST"; ppReq.ContentType = "application/x-www-form-urlencoded"; ppReq.ContentLength = query.Length; StreamWriter ppOut = new StreamWriter(ppReq.GetRequestStream(), System.Text.Encoding.ASCII);
The highlighted line is where the exception occurs. The site has a SSL certificate.
How to fix this?
Contributor
3710 Points
1043 Posts
Re: Could not create SSL/TLS secure channel
Sep 11, 2019 05:26 AM|Yongqing Yu|LINK
Hi wavemaster,
For this issue, you can add the following code at the beginning :
For more details, you could refer to this link : The request was aborted: Could not create SSL/TLS secure channel
If you are getting this problem while configuring PayPal, please note that they won't support SSL3 starting by December, 3rd 2018. You'll need to use TLS.
About PayPal, you can refer to this link : https://www.paypal.com/uk/webapps/mpp/ssl-security-update
Best Regards,
YongQing.
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Contributor
2613 Points
2719 Posts
Re: Could not create SSL/TLS secure channel
Sep 12, 2019 01:52 PM|wavemaster|LINK
I have implemented the code but have not been able to test it until I get some Paypal issues taken care off.