changes to support MDN
cert verfication changes
handle self-signed certs