title: Detect SSL hash algorithm with Python
body: <p>Now that SHA-1 will be banned next year by major browsers, I want to detect which sites are still using it. Is there a way to get this information using Python (such as <a href="https://docs.python.org/3/library/ssl.html" rel="nofollow noreferrer">Python's ssl library</a>)? I can use <code>openssl s_client</code> but I'd prefer a Pythonic solution (that is compatible with my async framework). </p>
  
  <p>s_client example:</p>
  
  <pre><code>$ openssl s_client -connect winkel.vpro.nl:443 &lt; /dev/null 2&gt;/dev/null | openssl x509 -text -in /dev/stdin | grep -i sha
  Signature Algorithm: sha1WithRSAEncryption
  </code></pre>
  
  <p>I dug through the ssl docs but couldn't find hash algo references. And I don't know how to get this info from the ssl context. TIA!</p>