Discarding untrusted certificates by default
Added a method to detect certificate error