xref: /PHP-7.3/ext/curl/tests/bug63795.phpt (revision 517f8002)
1--TEST--
2Bug #63795 (CURL >= 7.28.0 no longer support value 1 for CURLOPT_SSL_VERIFYHOST)
3--SKIPIF--
4<?php
5if (!extension_loaded("curl")) {
6        exit("skip curl extension not loaded");
7}
8$curl_version = curl_version();
9if ($curl_version['version_number'] < 0x071c01) {
10        exit("skip: test valid for libcurl >= 7.28.1");
11}
12?>
13--FILE--
14<?php
15$ch = curl_init();
16var_dump(curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false));
17/* Case that should throw an error */
18var_dump(curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true));
19var_dump(curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0));
20var_dump(curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1));
21var_dump(curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2));
22
23curl_close($ch);
24?>
25--EXPECTF--
26bool(true)
27
28Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in %s on line %d
29bool(true)
30bool(true)
31
32Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in %s on line %d
33bool(true)
34bool(true)
35