[Twisted-Python] HTTP/2 and getPeerCertificate
Glyph
glyph at twistedmatrix.com
Sat Aug 26 22:35:29 MDT 2017
> On Aug 25, 2017, at 2:50 PM, Lance Kurisaki <lkurisaki at yahoo.com> wrote:
>
> With HTTP/1.1, I used to be able to call request.transport.getPeerCertificate(). When the client uses HTTP/2, however, it seems that request.transport is None. How does one access the transport with HTTP/2? Thank you...
> Lance
I think this is just a bug; the `transport`. I filed it here: https://twistedmatrix.com/trac/ticket/9270 <https://twistedmatrix.com/trac/ticket/9270>
Please consider submitting a patch to Twisted so that this can be fixed in a useful way for everyone!
In the meanwhile, with the usual caveats about using private interfaces <https://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html> you can retrieve the transport via "request.channel._conn.transport" in http/2, and the "clientproto" attribute of the request will tell you which kind of request it is.
Thanks for using Twisted; sorry for this bug,
-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20170826/626b793d/attachment-0002.html>
More information about the Twisted-Python
mailing list