SSLSocket.get_verified_chain() and get_unverified_chain() raise AttributeError after the TLS layer is torn down
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
- gh-155328
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SSLSocket.get_verified_chain() and get_unverified_chain(), then compare their handling of self._sslobj with sibling query methods after unwrap(). Done means both methods no longer raise AttributeError when the TLS layer is torn down and their behavior matches the other query methods in that state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100