ASP. NET Core 2.1:13. Httpclient.getasync Report SSL Error issues

Source: Internet
Author: User
Tags dotnet ssl connection

I do not know when, there is such a strange problem, simple Httpclient.getasync ("xxxx") unexpectedly error.

First, the problem description

The original program from 2.0 to 2.1, suddenly found that the original normal operation of the Httpclient.getasync ("xxxx") actually did not work.

To exclude interference from other references in the project, a new clean 2.1 project was created, and the main directly called
New HttpClient ();  var task = client. Getasync (URL); 

is still an error.

The error message is as follows:

System.AggregateException:One or more errors occurred. (The SSL connection could not being established, see inner exception.) ---> System.Net.Http.HttpRequestException:The SSL Connection could not being established, see inner exception. --->Interop+crypto+opensslcryptographicexception:error:2006d002:bio routines:bio_new_file: System Lib at   Interop.Crypto.CheckValidOpenSslHandle (SafeHandle handle)   at Internal.Cryptography.Pal.StorePal.LoadMachineStores ()   *****************************************

I thought it was a bad time to upgrade the runtime, but it's still the same after the reinstallation.

System environment:

7 for support ):  2.1. 2   Commit:  811c3ce6c0.net Core runtimes installed:  2.1.  2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]  2.1.  2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]  2.1.  2 [/usr/share/dotnet/shared/microsoft.netcore.app]

By accident, running the corresponding DLL through the dotnet command will work:
Dotnet ...  xx/xx/test.dll

However, through the /etc/systemd/system/kestrel-test.service such a service startup situation still error.

It is certainly inappropriate to run through the dotnet command every time, and keep trying.

Second, the solution

This is because there are no Read permissions or corrupted files in the /etc/ssl/certs directory, look at this folder is indeed a recent few days a new file write, may be recently installed what come in.

No one of the test, temporarily set the public permissions of this folder can be read, can run normally, it is a temporary method, so open permissions is certainly not a good way,

It is said that in the new version will be repaired, re-brush a bit of yum update is not new, the official website to see also not 2.1.3 Runtime. I hope the new version will fix this problem earlier.

ASP. NET Core 2.1:13. Httpclient.getasync Report SSL Error issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.