ODBC can't find correct OpenSSL version.
See original GitHub issueEnvironment
- Python: 3.9.7
- pyodbc: 4.0.32
- OS: macOS big sur 11.6
- DB: SQL Server
- driver: ODBC Driver 17 for SQL Server
Issue
When trying to connect to our database, i get the following error:
[08001] [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection (0)
Looks like a duplicate of #610 but I don’t think it is. Since it looks like ODBC can’t find the correct OpenSSL, although it is installed.
When I run : DYLD_PRINT_LIBRARIES=1 isql -v -k "<connection string>"
I get:
...
dyld: loaded: /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth
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
So it looks like ODBC 17 requires OpenSSL 1.0 or 1.1, but it can’t find the correct version.
I have 1.1 installed:
➜ ~ brew list | grep ^openssl
openssl@1.1
openssl@3
But standard version is 3:
➜ ~ openssl version
OpenSSL 3.0.0 7 sep 2021 (Library: OpenSSL 3.0.0 7 sep 2021)
I tried to remove all links in /usr/local/opt/ and relink with ln -s /usr/local/Cellar/openssl@1.1/1.1.1l_1 /usr/local/opt/openssl, which solved the problem for ODBC, but that broke some other Python libraries, like pip and jupyterlab.
How can I solve this problem?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
ODBC driver can't find correct openSSL version after ...
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...
Read more >ODBC can't find correct OpenSSL version after upgrading ...
After trying many things, I found a (hacky) solution: I removed the link in /usr/local/opt/ : rm openssl. Created a new link to...
Read more >ODBC can't find correct OpenSSL version after upgrading ...
Coding example for the question ODBC can't find correct OpenSSL version after upgrading OpenSSL-sql-server.
Read more >#60560 (mssql-tools seems to be missing OpenSSL) – MacPorts
Hi,. to reproduce the issue simply run MSSQL 2019 as a docker instance docker run --rm -it -p 1433:1433 --name mssql-server -e 'ACCEPT_EULA=Y'...
Read more >How to determine the version of OpenSSL library that ships ...
Is there a command or tool that can tell the version of OpenSSL library that is installed with the DataDirect Connect for ODBC...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After trying many things, I found a (hacky) solution:
/usr/local/opt/:openssl@1.1Can we leave this issue “open” for now, hopefully someone will come with a better more stable solution.
if you don’t want to break other programs
DYLD_LIBRARY_PATH=/usr/local/Cellar/openssl@1.1/1.1.1l_1/lib/ isql -v -k ...This will put the openssl 1.1 first in the dynamic library search path.