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

Posted by Tomas on Stack Overflow See other posts from Stack Overflow or by Tomas
Published on 2012-09-03T09:36:38Z Indexed on 2012/09/03 9:37 UTC
Read the original article Hit count: 997

Filed under:
|
|

I am using WebClient in ASP.NET app to call PayPal secured url to create payment button. While calling secured PayPal Url I get error below. How to solve this problem? Do I need to purchase certificate to just call secured url?

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

My code

            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
            using (var client = new WebClient())
            {
                var postBytes = Encoding.ASCII.GetBytes(param);
                client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
                responseBytes = client.UploadData(_paymentProcessorCredentials.PayPalApiUrl, "POST", postBytes);
            }

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET