Experimental ssl pinning

Some minor improvements for SSL pinning.