Fix .NET Error SSL Connection Cannot Be Established

1. Problem description

The request with exception: The SSL connection could not be established, see inner exception. requestId

Clearly, an SSL connection issue.

2. Solution

Check the OpenSSL path first:

Bash
1
openssl version -a

which has a line:

Text
1
OPENSSLDIR: "/etc/pki/tls"

hint:
Your path is not necessarily the same as mine, if it is a Docker environment, it may be/usr/local/openssl/or others.

The path is the OpenSSL path, followed by/certget the certificate path:

/etc/pki/tls/cert/

Copy the server default CA certificate:

Bash
1
cp /etc/pki/tls/cert.pem <previously obtained path>

For example:

Bash
1
cp /etc/pki/tls/cert.pem /usr/local/openssl/cert/

That should solve the problem.

Notice:
If it is a Docker environment, there may be no system default CA certificate, which needs to be copied from the host through file mapping, etc., and then copied to the OpenSSL directory.

Fix .NET Error SSL Connection Cannot Be Established

https://blog.tsinbei.com/en/archives/728/

Author
Ηsukqi Lee
Posted on

2023-05-24

Edited on

2023-05-24

Licensed under

CC BY-NC-ND 4.0

Comments

Name
Mail
Site
None yet