New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The SSL connection could not be established on Ubuntu #1941
Comments
There are two main possibilities. One is you don't have any trusted roots installed. The second is that you're seeing a problem that we've so far only seen on SLES15 and Fedora28 regarding the contents of the trusted roots store. I can't reproduce the problem on Ubuntu 18.04, I just did an update/upgrade and manually invoked The simplest diagnostic test is to set two environment variables before running your program: export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
export SSL_CERT_DIR=/dev/null If your program is successful after that, then this is the same as https://github.com/dotnet/corefx/issues/32224. |
Issue moved to dotnet/corefx #32300 via ZenHub |
@bartonjs when I set this environment variables, my program is successful. |
This worked for me too, hosting under CentOS on Webfaction. |
I have simple app that get request to website like this:
This code work fine on Windows, but on Ubuntu 18.04 it crash with error:
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
This code work fine on Ubuntu only with websites that using http protocol.
Why it does not work with https?
dotnet --info:
.NET Core SDK (reflecting any global.json):
Version: 2.1.401
Commit: 91b1c13032
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.401/
Host (useful for support):
Version: 2.1.3
Commit: 124038c13e
.NET Core SDKs installed:
2.1.401 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
The text was updated successfully, but these errors were encountered: