• Ubuntu 20.4无法访问sqlserver2012数据库问题- OpenSSL error 错误


     win10 的子系统,装上了Ubuntu20.4,然后部署了dotnet-sdk-2.1,把自己的dotnet 2.1网站部署上去之后运行 

     看着好像正常,一访问发现没法访问,报了个异常:

    Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. 
    (provider: TCP Provider, error: 35 - An internal exception was caught) System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL. Interop+Crypto+OpenSslCryptographicException: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol

    简而言之就是:SSL Handshake failed with OpenSSL error

    大致意思是连接服务器成功,但是在握手的时候报了异常,里面有 openssl、ssl_error 这样的字眼,回顾了一下,

    同样的部署方式,在centos 7阿里云服务器里面是没有这个问题的,推测代码和环境都是没有问题的,然后看了下

    自己装的ubuntu20.4,是最新的Ubuntu版本,还跟openssl有关系,那么会不是 LTS的问题,查看下

    openssl version,出来 OpenSSL 1.1.1f ,它是2020年3月份发布的,那我的sql版本是好几年前的,肯定对不上

    了,问题找到,降级openssl版本吧。

    步骤(注意使用root运行):

    1. 下载包: 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 检查下有没有问题
    8. 备份一下现在的openssl: sudo mv /usr/bin/openssl ~/tmp
    9. 执行安装: sudo make install.
    10. 创建软连接: ln -s /usr/local/bin/openssl /usr/bin/openssl
    11. 运行命令 sudo ldconfig 更新一下软连接和缓存.

        然后来看看:

      openssl version

    输出了下面的信息就证明降级成功了
      OpenSSL 1.1.1  11 Sep 2018
  • 相关阅读:
    ubuntu18【合上盖子不休眠】
    linux和windows双系统开机显示 Minimal BASHlike line editingis supported xxxxxx
    Linux下opera不支持h5播放器的解决方法
    linux openjdk路径
    Linux安装redis tar.gz
    dpkg 安装deb文件
    Linux破解Navicat15
    kali设置grub主题
    kali安装git tar.gz
    kali 安装 teamviewer 显示检测到wayland
  • 原文地址:https://www.cnblogs.com/shellphen/p/13544571.html
Copyright © 2020-2023  润新知