[openssl] Support wildcard hostname verification

Most of this code comes from version Curl 7.35.