Fix self-signed certificate issue (issue 698)