Public bug reported:

python-pykmip 0.10.0-12 fails to build from source in Ubuntu (blocking
proposed-migration 0.10.0-10 -> 0.10.0-12) with:

  File "/<<PKGBUILDDIR>>/kmip/services/auth.py", line 187, in __init__
    self._protocol = ssl.PROTOCOL_TLSv1
                     ^^^^^^^^^^^^^^^^^^
  AttributeError: module 'ssl' has no attribute 'PROTOCOL_TLSv1'. Did you mean 
'.PROTOCOL_TLS' instead of '.PROTOCOL_TLSv1'?

14 tests fail during dh_auto_test (TestBasicAuthenticationSuite.* and 
TestKmipServer.* in
kmip/tests/unit/services/test_auth.py and test_server.py), all tracing back to 
the same
BasicAuthenticationSuite.__init__ in kmip/services/auth.py:187 referencing 
ssl.PROTOCOL_TLSv1
directly.

Build log: https://launchpad.net/ubuntu/+source/python-
pykmip/0.10.0-12/+build/34029837

Root cause analysis:
I compared this build side-by-side with Debian's successful build of the 
identical
0.10.0-12 source (Debian buildd log, built 2026-11-23). Both distros run the 
exact same
test invocation (debian/rules): 'for i in 3.15 3.14; do python -m coverage run 
... pytest ...; done',
and both use the *same* Python versions (3.15.2 and 3.14.10 - confirmed 
identical package
versions installed in both build chroots). Debian's python3.15.2 run passes 
cleanly
(3359 passed, 35 skipped). Ubuntu's python3.15.2 run fails with the 
AttributeError above.

Since the Python version is identical between the two distros, the difference 
must come
from how each distro's Python/OpenSSL was compiled: ssl.PROTOCOL_TLSv1 is only 
exposed by
CPython's _ssl module when the OpenSSL it was built against still has legacy 
TLSv1 method
support compiled in. This suggests Ubuntu's Python 3.15/OpenSSL build no longer 
exposes
this constant, while Debian's still does (at least as of their Nov 2026 build).

Upstream status:
This is a long-standing, *already known and still open* upstream issue:
https://github.com/OpenKMIP/PyKMIP/issues/719
('ssl.PROTOCOL_TLS, ssl.PROTOCOL_TLSv1_2, and so on are deprecated', open since 
July 2024,
recommending ssl.PROTOCOL_TLS_CLIENT / ssl.PROTOCOL_TLS_SERVER instead). A 
later PR
(https://github.com/OpenKMIP/PyKMIP/pull/737, 'make server.py compatible with 
Python3.13')
only touches kmip/services/server/server.py, not kmip/services/auth.py, so the 
exact
code path hit here was never fixed upstream.

Suggested fix:
Patch kmip/services/auth.py's BasicAuthenticationSuite.__init__ to use
ssl.PROTOCOL_TLS_SERVER (or ssl.PROTOCOL_TLS as a minimal change) instead of 
the removed
ssl.PROTOCOL_TLSv1 constant, ideally upstreamed given issue #719 is still open 
and will
eventually affect Debian too as their Python/OpenSSL catches up.

** Affects: python-pykmip (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: update-excuses

** Tags added: update-excuses

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2178443

Title:
  python-pykmip: FTBFS with AttributeError: module 'ssl' has no
  attribute 'PROTOCOL_TLSv1'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-pykmip/+bug/2178443/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to