I'm looking for a way to get to the information about SSL certificate used by the remote site using requests (CA and CN would suffice).
I can easily get those when I use for example socket + OpenSSL, but in my code I use a special resolver ( Python 'requests' library - define specific DNS? ), so I need to use Requests or urllib2 - so far I examined most of the requests code through inspect module, and I see no way of getting to these values.
I'd appreciate any hints at this point, maybe I'm missing something obvious :)
[edit]:
To be more precise - I'm patching part of the requests lib (from 'socket' up to urllib2), to use a custom name resolver- it comes down to this:
self.my_opener = urllib2.build_opener(MyHTTPHandler,MyHTTPSHandler) (urllib2.OpenerDirector instance)
my_opener.open(url) returns an urllib.addinfourl object - from which I would need to extract certificate info if that's at all posible.
Unfortunately this is not the case for the question after which this one was marked as a duplicate.