Fixing bypass of server certificate check