fix bugs with CURL adapater over SSL