Last post Sep 12, 2019 01:52 PM by wavemaster
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?
Sep 11, 2019 05:26 AM|Yongqing Yu|LINK
Could not create SSL/TLS secure channel
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
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
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.