macOS: encrypted connections fail after Homebrew moved the `openssl` alias to `openssl@4`
Les mainteneurs répondent en général sous 2 jours
@bewithgaurav y travaille déjà.
Depuis le 30/9/2026.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 55/100
Piste de recherche
Start with the README installation instructions and the bundled mssql_python_odbc/libs/macos/arm64/lib/libmsodbcsql.18.dylib, then reproduce both Homebrew OpenSSL 3 and OpenSSL 4 cases on Apple silicon. Done means encrypted connections work with the supported OpenSSL setup and the README no longer directs users to a failing installation.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
On macOS with Homebrew, every encrypted connection fails because the bundled ODBC driver cannot load OpenSSL. The cause is Homebrew/homebrew-core#313581, which moved the openssl alias from openssl@3 to openssl@4 on 2026-09-27.
The bundled libmsodbcsql.18.dylib loads OpenSSL only from these two paths:
/opt/homebrew/opt/openssl/lib/
/usr/local/opt/openssl/lib/
In each path, it tries libssl.1.1.dylib and the unversioned libssl.dylib (from strings .../mssql_python_odbc/libs/macos/arm64/lib/libmsodbcsql.18.dylib).
On 2026-09-27, Homebrew moved the openssl alias from openssl@3 to openssl@4 in Homebrew/homebrew-core#313581. The migration is tracked in Homebrew/homebrew-core#278366. Now /opt/homebrew/opt/openssl belongs to openssl@4. When only openssl@3 is installed, brew upgrade removes the link, and the driver finds no OpenSSL.
When openssl@4 is installed, libssl.dylib in that path is OpenSSL 4. The driver loads libssl.4.dylib from the openssl@4 4.0.2_1 bottle, then refuses it with the same error. So the README install step brew install openssl now gives a setup that cannot connect.
Exception message:
mssql_python.exceptions.OperationalError: Driver Error: Client unable to establish connection; DDBC Error: [Microsoft]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0, 1.1, or 3.0 is installed]
Stack trace:
.venv/lib/python3.14/site-packages/mssql_python/db_connection.py:89: in connect
conn = Connection(
.venv/lib/python3.14/site-packages/mssql_python/connection.py:753: in __init__
_raise_connection_error(e)
.venv/lib/python3.14/site-packages/mssql_python/connection.py:125: in _raise_connection_error
raise exc from None
To reproduce
Case A, only OpenSSL 3:
- On Apple silicon, install
openssl@3with Homebrew, and do not installopenssl@4. - Confirm that
/opt/homebrew/opt/openssldoes not exist. - Run the code below.
Case B, OpenSSL 4:
- Run
brew install openssl, as the README says. This installsopenssl@4. - Run the code below.
DYLD_PRINT_LIBRARIES=1showslibssl.4.dylibload before the error.
from mssql_python import connect
connect("Server=tcp:<server>.database.windows.net,1433;Database=<database>;Encrypt=yes;Authentication=ActiveDirectoryDefault")
Workaround: ln -s openssl@3 /opt/homebrew/opt/openssl. After that, the connection succeeds.
Expected behavior
The driver connects with the OpenSSL that Homebrew's openssl installs now, which is OpenSSL 4. If the driver cannot support OpenSSL 4, it finds OpenSSL 3 from openssl@3, for example at /opt/homebrew/opt/openssl@3/lib/, and the README names openssl@3.
Further technical details
Python version: 3.14.7
SQL Server version: Azure SQL Database (serverless)
Operating system: macOS 27.0, arm64
mssql-python: 1.15.0
mssql-python-odbc: 18.6.2.1
Homebrew: 7.0.7, openssl@3 3.6.4_1
Additional context
A later install of openssl@4, for example as a dependency of another formula, takes the openssl link back. Then the driver loads OpenSSL 4 and fails as in case B.
- Langage dominant
- Python
- Étoiles
- 478
- Forks
- 62
- Merge moyen
- 3 j 1 h
- PR mergées (30 j)
- 26
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/mssql-python
-
area: bulk-copy triage needed
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
microsoft/mssql-python#843 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
triage needed
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
microsoft/mssql-python#850 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
bulkcopy() fails with SQL error 7339 for UTF-8 multibyte characters against Fabric WarehouseOuvertetriage needed
Difficulté 4/5 3-5 jours Accessibilité débutants 22/100
microsoft/mssql-python#849 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
triage needed
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
microsoft/mssql-python#848 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
triage needed
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
microsoft/mssql-python#846 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de microsoft/mssql-python
Issues similaires
-
Custom provider API keys collide on one host: env slot keyed on host:port only, not URL pathOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
NousResearch/hermes-agent#140958 ·
Les mainteneurs répondent en général sous 1 jour
-
Bisect issue233186Ouvertebisect
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
dtcxzyw/llvm-bisect-service#548 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
sallowayma-git/IELTS-practice#248 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
anthropics/claude-plugins-official#6763 · 10 commentaires · 10 réactions ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour