-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't specify both fingerprint and SSLContext for client request #3679
Comments
It looks like those were dropped in #3548 |
@asvetlov it looks like an API design regression: we should probably separate ssl context and fingerprint. Another thought: one arg to rule them all smells like a godobject antipattern. Maybe it's a wrong decision after all? |
Following up on this... I see a couple of options here:
I'm happy to submit a patch if we can reach agreement on the best path forward. |
Yeah, Andrew and I discussed this privately and thought that it probably needs to be done on the stdlib side and is probably in the scope of https://www.python.org/dev/peps/pep-0543/ (which I notified @tiran about, I think he wanted to add come hook for an extra validation callback). Personally, I think that it's probably mostly fine to extend |
Thanks for the update. I did some experimentation with the multiple inheritance route; unfortunately it doesn't look easy to create an object that looks like both a For now I can work around the issue by implementing a subclass of |
It's currently not possible to implement cert pinning with Python's ssl module. To implement it correctly, the pinned cert must be verified during the handshake. In case of an error, the handshake must be aborted before a client cert is verified and error must be signalled with a |
@tiran is that because the client cert may contain sensitive data? |
Long story short
It appears that 4.0 will remove all the SSL parameters from the
TCPConnector
class except for a singlessl
parameter (#2626). This appears to be quite limiting: for example, it would no longer be possible to supply a client certificate and simultaneously pin the expected server certificate. The former requires you to pass theSSLContext
configured with the client certificate as thessl
parameter, but for the latter you would have to pass aFingerprint
. Is there a recommendation for how this could be achieved?Expected behaviour
Should be possible to make a request with BOTH a client certificate and a pinned server certificate.
Actual behaviour
It appears this will be removed with no alternative offered in 4.0.
Steps to reproduce
N/A
Your environment
client
The text was updated successfully, but these errors were encountered: