allow pinning / giving specific server certificate to check for

This will apps allow to provide a custom trust anchor. This can be interesting for two cases:

1. self signed certificates or untrusted CAs (such as CACert.org)
2. pinning