title: Python requests library - get SSL certificate information
body: <p>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).</p>
  
  <p>I can easily get those when I use for example socket + OpenSSL, but in my code I use a special resolver ( <a href="https://stackoverflow.com/questions/22609385/python-requests-library-define-specific-dns">Python &#39;requests&#39; library - define specific DNS?</a> ), 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.</p>
  
  <p>I'd appreciate any hints at this point, maybe I'm missing something obvious :)</p>
  
  <p>[edit]:</p>
  
  <p>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:</p>
  
  <p>self.my_opener = urllib2.build_opener(MyHTTPHandler,MyHTTPSHandler) (urllib2.OpenerDirector instance)</p>
  
  <p>my_opener.open(url) returns an urllib.addinfourl object - from which I would need to extract certificate info if that's at all posible.</p>
  
  <p>Unfortunately this is not the case for the question after which this one was marked as a duplicate.</p>