[Solved] Accessing MSSql under Ubuntu prompts SSL Handshake failed with OpenSSL error

In short: SSL Handshake failed with OpenSSL error

It roughly means that the connection to the server was successful, but an exception was reported during the handshake. There were words like openssl and ssl_error in it. After reviewing it,

The same deployment method does not have this problem in the centos 7 Alibaba Cloud server. It is speculated that there is no problem with the code and environment, and then I took a look.

I installed ubuntu 20.4, which is the latest version of Ubuntu, and has something to do with openssl. Then it’s not a problem with LTS, check it out

openssl version, OpenSSL 1.1.1f comes out, it was released in March 2020, then my sql version is several years ago, it must not be right

The problem is found, downgrade the openssl version.

Steps (note the use of root operation):

  1. Download package: wget https://www.openssl.org/source/openssl-1.1.1.tar.gz
  2. 解压: tar -zxf openssl-1.1.1.tar.gz
  3. cd openssl-1.1.1
  4.  . /config.
  5. apt install make gcc
  6. make
  7. make test Check if there are any problems
  8. Back up the current openssl: sudo mv /usr/bin/openssl ~/tmp
  9. Perform the installation:  sudo make install.
  10. Create a soft connection: ln -s /usr/local/bin/openssl /usr/bin/openssl
  11. Run the command to  sudo ldconfig update the soft connection and cache.

Then take a look:

  openssl version

 The following information is output to prove that the downgrade is successful
  OpenSSL 1.1.1  11 Sep 2018

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *