eos-sharp icon indicating copy to clipboard operation
eos-sharp copied to clipboard

Use TLS 1.2 in ASP.NET Core 3.1

Open alaa-m opened this issue 5 years ago • 1 comments

Hi guys,

I am using eos-sharp with Xamarin to build a wallet app for eos.io bloackchain

The problem is when I tried to connect to Blockchain node which support only TLS1.2

HttpClient couldn't connect to node and thrown SSL exception:

The SSL connection could not be established.

After doing some research I found that the solution is to add

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

before connection to Blockchain node API. But unfortunately it doesn't affect HttpClient on .Net Core

Finally I found this Solution on Stackoverflow

https://stackoverflow.com/questions/49399205/how-to-use-tls-1-2-in-asp-net-core-2-0

And the solution is to use HttpHandler with HttpClient :

var handler = new HttpClientHandler { SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls };

HttpClient client = new HttpClient(handler);

My question is can I addHttoClient Handler which supports TLS12 to EosSharpHttpHandler

And make it optionally to force support tls12?

Thanks

alaa-m avatar Jun 01 '20 18:06 alaa-m

@alaa-m Hi, have you find any solutions? I am having trouble with http requests to the node

adolfommoyano avatar Oct 13 '22 13:10 adolfommoyano