Add certificate checking feature.

Add an option to check the certificate chain for SSL/TLS connections.
Also add an option to check against a fixed SHA-1 fingerprint.