Bug report
SSLSocket.get_verified_chain() and SSLSocket.get_unverified_chain() raise
AttributeError when called after the socket's TLS layer is torn down (for
example after unwrap()), while every other query method (cipher(),
version(), group(), ...) returns a value:
>>> s.unwrap()
>>> s.get_verified_chain()
Traceback (most recent call last):
...
AttributeError: 'NoneType' object has no attribute 'get_verified_chain'
The two methods access self._sslobj without the _checkClosed() /
if self._sslobj is None guard the sibling methods use. They were added in
gh-109113 (3.13), so 3.13 and later are affected.
CPython versions tested on:
3.16 (main)
Operating systems tested on:
Linux, macOS
Linked PRs
Bug report
SSLSocket.get_verified_chain()andSSLSocket.get_unverified_chain()raiseAttributeErrorwhen called after the socket's TLS layer is torn down (forexample after
unwrap()), while every other query method (cipher(),version(),group(), ...) returns a value:The two methods access
self._sslobjwithout the_checkClosed()/if self._sslobj is Noneguard the sibling methods use. They were added ingh-109113 (3.13), so 3.13 and later are affected.
CPython versions tested on:
3.16 (main)
Operating systems tested on:
Linux, macOS
Linked PRs