This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author njs
Recipients Hiroaki.Kawai, asmodai, chaen, chet, chrisburr, christian.heimes, dsoprea, dstufft, jcea, joernheissler, kwatsen, maker, miki725, mmasztalerczuk, njs, pitrou, underrun
Date 2020-01-31.00:37:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> For the concern issue, as I understand it, the ability to call getpeercert() or the proposed getpeercertchain() is only after the TLS session has been established.  As such, the SSL socket already established that there exists a valid chain of trust.  Thus these methods are primarily to provide visibility into what the peer passed *after* it had been authenticated, right?

The issue is that "the cert chain provided by the client" and "the cert chain that was validated as trustworthy" might be different. For example, say you have trust roots A and B, and I have a leaf certificate with a valid signature by B. If I pass the chain [A, leaf cert], then openssl's trust validation code might look at that and say "yep, this leaf cert is signed by root B, I trust root B, cool, the connection is good. Also there's a random A cert here, but whatever, that doesn't change anything".

In this case, for your use case, you want to get back the chain [B, leaf cert], because that's the chain that was actually validated. If you instead got the chain the client gave you, then you might be fooled into thinking that this cert chained to root A, when it actually didn't, and make the wrong trust decision.

That's why we need to be careful to distinguish between these two possible chains.
Date User Action Args
2020-01-31 00:37:08njssetrecipients: + njs, jcea, pitrou, christian.heimes, asmodai, maker, Hiroaki.Kawai, underrun, dstufft, dsoprea, miki725, mmasztalerczuk, chet, joernheissler, chaen, chrisburr, kwatsen
2020-01-31 00:37:08njssetmessageid: <>
2020-01-31 00:37:08njslinkissue18233 messages
2020-01-31 00:37:07njscreate