升级 OpenSSL 后 ODBC 找不到正确的 OpenSSL 版本

ODBC can#39;t find correct OpenSSL version after upgrading OpenSSL(升级 OpenSSL 后 ODBC 找不到正确的 OpenSSL 版本)
本文介绍了升级 OpenSSL 后 ODBC 找不到正确的 OpenSSL 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:如果您遇到同样的问题,正在讨论问题的根源

我该如何解决这个问题?对这个不是很熟悉.所以ODBC需要找到正确的OpenSSL版本,即1.1.

我试过了:

ln -s/usr/local/Cellar/openssl@1.1/1.1.1g/usr/local/opt/openssl

此外,当我运行 openssl 命令时,它会找到正确的版本:

➜ ~ opensslOpenSSL>版本OpenSSL 1.1.1l 2021 年 8 月 24 日OpenSSL>


输出 brew list openssl@1.1

/usr/local/Cellar/openssl@1.1/1.1.1l_1/.bottle/etc/(7 个文件)/usr/local/Cellar/openssl@1.1/1.1.1l_1/bin/c_rehash/usr/local/Cellar/openssl@1.1/1.1.1l_1/bin/openssl/usr/local/Cellar/openssl@1.1/1.1.1l_1/include/openssl/(104 个文件)/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/libcrypto.1.1.dylib/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/libssl.1.1.dylib/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/engines-1.1/(2个文件)/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/pkgconfig/(3 个文件)/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/(4 个其他文件)/usr/local/Cellar/openssl@1.1/1.1.1l_1/share/doc/(3971 个文件)/usr/local/Cellar/openssl@1.1/1.1.1l_1/share/man/(3971 个文件)➜ ~

ls -l/usr/local/opt/openssl/lib/libssl.dylib 的输出

lrwxr-xr-x 1 用户名 admin 14 Sep 7 13:46/usr/local/opt/openssl/lib/libssl.dylib ->libssl.3.dylib

同时运行 DYLD_PRINT_LIBRARIES=1 isql -v -k "<connection string" 给我以下内容.似乎它仍然链接到 openssl@3

dyld:加载:/usr/local/opt/openssl/lib/libssl.dylibdyld:加载:/usr/local/Cellar/openssl@3/3.0.0/lib/libcrypto.3.dylib[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL 提供程序:[无法加载 OpenSSL 库,请确保已安装 OpenSSL 1.0 或 1.1][08001][Microsoft][ODBC Driver 17 for SQL Server]客户端无法建立连接[ISQL]错误:无法 SQLDriverConnect

解决方案

在尝试了很多事情之后,我找到了一个(hacky)解决方案:

  1. 我删除了 /usr/local/opt/ 中的链接:

rm openssl

  1. 创建了一个指向 openssl@1.1 的新链接

ln -s/usr/local/Cellar/openssl@1.1/1.1.1l_1/usr/local/opt/openssl

Update: if you have this same issue, the source of the problem is being discussed here


After upgrading to Python3.10 with homebrew, my OpenSSL was upgraded to version 3 as well.

Now I can't connect to my SQL Server anymore, since ODBC requires OpenSSL 1.1 or 1.0. So when I run:

isql -v -k "<connection string"

I get the following error:

[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed]
[08001][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection

But when I look in /usr/local/etc/ I see that openssl@1.1 is installed:

How can I solve this problem? Not really familiar with this. So ODBC needs to find the correct OpenSSL version, which is 1.1.

I tried:

ln -s /usr/local/Cellar/openssl@1.1/1.1.1g /usr/local/opt/openssl

Also when I run openssl command, it finds the correct version:

➜  ~ openssl
OpenSSL> version
OpenSSL 1.1.1l  24 Aug 2021
OpenSSL> 


Output brew list openssl@1.1

/usr/local/Cellar/openssl@1.1/1.1.1l_1/.bottle/etc/ (7 files)
/usr/local/Cellar/openssl@1.1/1.1.1l_1/bin/c_rehash
/usr/local/Cellar/openssl@1.1/1.1.1l_1/bin/openssl
/usr/local/Cellar/openssl@1.1/1.1.1l_1/include/openssl/ (104 files)
/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/libcrypto.1.1.dylib
/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/libssl.1.1.dylib
/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/engines-1.1/ (2 files)
/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/pkgconfig/ (3 files)
/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/ (4 other files)
/usr/local/Cellar/openssl@1.1/1.1.1l_1/share/doc/ (3971 files)
/usr/local/Cellar/openssl@1.1/1.1.1l_1/share/man/ (3971 files)
➜  ~ 

Output of ls -l /usr/local/opt/openssl/lib/libssl.dylib

lrwxr-xr-x  1 username  admin  14 Sep  7 13:46 /usr/local/opt/openssl/lib/libssl.dylib -> libssl.3.dylib

Also running DYLD_PRINT_LIBRARIES=1 isql -v -k "<connection string" gives me the following. Seems like it is still linked to openssl@3

dyld: loaded:  /usr/local/opt/openssl/lib/libssl.dylib
dyld: loaded: /usr/local/Cellar/openssl@3/3.0.0/lib/libcrypto.3.dylib
[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed]
[08001][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
[ISQL]ERROR: Could not SQLDriverConnect

解决方案

After trying many things, I found a (hacky) solution:

  1. I removed the link in /usr/local/opt/:

rm openssl

  1. Created a new link to openssl@1.1

ln -s /usr/local/Cellar/openssl@1.1/1.1.1l_1 /usr/local/opt/openssl

这篇关于升级 OpenSSL 后 ODBC 找不到正确的 OpenSSL 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)
How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?(如何使用Microsoft SQL Server Management Studio生成数据库的实体关系(ER)图?)