Skip to content

gh-155327: Guard SSLSocket chain methods after TLS teardown - #155328

Open
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:fix-sslsocket-chain-guard
Open

gh-155327: Guard SSLSocket chain methods after TLS teardown#155328
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:fix-sslsocket-chain-guard

Conversation

@tonghuaroot

@tonghuaroot tonghuaroot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

SSLSocket.get_verified_chain() and get_unverified_chain() accessed
self._sslobj without the _checkClosed() / None guard used by every other
query method, so they raised AttributeError when called after the TLS layer
was torn down (for example after unwrap()). Add the guard and return an empty
list, matching the value these methods return for an empty chain.

get_verified_chain() and get_unverified_chain() accessed self._sslobj without
the guard used by the other query methods, raising AttributeError after
unwrap(). Return an empty list instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant