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