Viincenttt / MollieApi

This project allows you to easily add the Mollie payment provider to your application.
MIT License
148 stars 85 forks source link

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

Closed Moxh3 closed 2 years ago

Moxh3 commented 2 years ago

When executing paymentClient.CreatePaymentAsync(paymentRequest) with Mollie.Api 2.1.0.8 I receive a "The request was aborted: Could not create SSL/TLS secure channel." WebException when debugging locally each time. I have no clue whatsoever what's happening, but it's from a project that I updated from a quite old mollie.api.

The only error information I have is Exception information: Exception type: WebException Exception message: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)

Viincenttt commented 2 years ago

Hi @Moxh3 ,

I think this is probably a SSL TLS version issue. Please take a look at this issue: #236 There are a few solutions listed in the issue.

I am curious which OS and .NET version you are using, since you are experiencing this issue locally. By default, .NET will use the TLS version that is supported by the OS and you should avoid hardcoding the TLS version. See the following Microsoft documentation on this subject: https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls

Let me know if this helps! :)

Kind regards, Vincent

Moxh3 commented 2 years ago
    Hi Vincent,Thanks, but I've upgraded the project to .NET Framework 4.6 and the issue persists. I'm running dev on a fully patched Windows 10 client. So I'd be flabbergasted if it were to do with (a lack of) TLS 1.2 support. Anyhow I'll test/check a few things.Regs,Eaglan

 From: Vincent Kok @.***>Sent: Thursday, September 16, 2021 4:07 amTo: Viincenttt/MollieApiCc: Moxh3; MentionSubject: Re: [Viincenttt/MollieApi] The request was aborted: Could not create SSL/TLS secure channel (#254)  Hi @Moxh3 , I think this is probably a SSL TLS version issue. Please take a look at this issue: #236 There are a few solutions listed in the issue. I am curious which OS and .NET version you are using, since you are experiencing this issue locally. By default, .NET will use the TLS version that is supported by the OS and you should avoid hardcoding the TLS version. See the following Microsoft documentation on this subject: https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls Let me know if this helps! :) Kind regards, Vincent

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

[ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/Viincenttt/MollieApi/issues/254#issuecomment-920258465", "url": "https://github.com/Viincenttt/MollieApi/issues/254#issuecomment-920258465", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Moxh3 commented 2 years ago

The problem is fixed by setting ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 before calling await paymentClient.CreatePaymentAsync(paymentRequest)