Fix SSL Pinning

Based on what I found in #899, I think this pull request makes pinning with a public key actually functional. In addition, I updated the example to use pinning.