title: How to predetermine OkHTTP sha1 hash for Certificate Pinning?
body: <p>I would like to predetermine sha1 hashes for certificate pinning using okhttp CertificatePinner Builder. The <a href="https://github.com/square/okhttp/blob/83090befcca69b44c257b96afb519ca66282ca63/okhttp/src/main/java/com/squareup/okhttp/CertificatePinner.java#L43" rel="nofollow">sample code</a> mentions to try accessing an https url with a bad pin hash and then review the exception to get the actual hash.</p>
  
  <p>Ideally, if I already new my certificate's signature and chain information by reviewing published certificate public keys and associated sha1 signature I could just take the hash from the public docs or my browser view of the certificate details.</p>
  
  <p>Unfortunately, the "sha1 signature" value displayed for a certificate is in hex format and does not seem to obviously correlate to the sha1 hash shown in the exception.</p>
  
  <p>Is there any way for me to determine the sha1 has to use for Certificate Pinning without going through the exception process? </p>
  
  <p>Also, not sure if the "sha1 hash" to be used for Okhttp is synonymous with a certificate "thumbprint"?</p>