The readme sample using google pins doesn't validate for me. Looking through stackoverflow I found the following shell script which uses openssl to obtain the certificate of a server:
#!/bin/sh
# Based on http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html
SERVER=www.google.com:443
echo | openssl s_client -connect ${SERVER} 2>&1 | \
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > mycert.pem &&
cat mycert.pem &&
echo "Generated pem file"
Running this generates a file which used with the pin.py tool outputs:
However when I paste the pin value into the readme HttpsURLConnection sample I get an exception javax.net.ssl.SSLHandshakeException: No valid pins found in chain!. Which seems to indicate I'm not getting correctly the certificate. How should I retrieve the cert from google and other public websites?
The readme sample using google pins doesn't validate for me. Looking through stackoverflow I found the following shell script which uses openssl to obtain the certificate of a server:
Running this generates a file which used with the
pin.py
tool outputs:However when I paste the pin value into the readme
HttpsURLConnection
sample I get an exceptionjavax.net.ssl.SSLHandshakeException: No valid pins found in chain!
. Which seems to indicate I'm not getting correctly the certificate. How should I retrieve the cert from google and other public websites?