Commit Graph

3 Commits

Author SHA1 Message Date
Travis Burtrum be1a505189 SSL: Add PEM format support for public key pinning 2014-11-24 19:30:09 +01:00
Daniel Stenberg 445aab4b73 tests: add new feature 'SSLpinning'
... and make test 2034 and 2035 require it, and have it set when built
with OpenSSL or GnuTLS.
2014-11-04 23:02:09 +01:00
Travis Burtrum 93e450793c SSL: implement public key pinning
Option --pinnedpubkey takes a path to a public key in DER format and
only connect if it matches (currently only implemented with OpenSSL).

Provides CURLOPT_PINNEDPUBLICKEY for curl_easy_setopt().

Extract a public RSA key from a website like so:
openssl s_client -connect google.com:443 2>&1 < /dev/null | \
sed -n '/-----BEGIN/,/-----END/p' | openssl x509 -noout -pubkey \
| openssl rsa -pubin -outform DER > google.com.der
2014-10-07 14:44:19 +02:00