Skip to content

Commit af10e69

Browse files
committed
Fixed bug #63352 (Can't enable hostname validation when using curl stream wrappers)
1 parent 517f800 commit af10e69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/curl/streams.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
331331
}
332332

333333
if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
334-
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1);
334+
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 2);
335335
} else {
336336
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
337337
}
@@ -420,7 +420,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
420420
}
421421
} else if (context && !strncasecmp(filename, "ftps", sizeof("ftps")-1)) {
422422
if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
423-
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1);
423+
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 2);
424424
} else {
425425
curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
426426
}

0 commit comments

Comments
 (0)