Skip to content

Use TLS 1.2 in ASP.NET Core 3.1 #47

@alaa-m

Description

@alaa-m

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions