xref: /PHP-7.1/ext/curl/tests/bug63363.phpt (revision 517f8002)
1--TEST--
2Bug #63363 (CURL silently accepts boolean value for 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 with value 1 is deprecated and will be removed as of libcurl 7.28.1. It is recommended to use value 2 instead in %s on line %d
29bool(true)
30bool(true)
31
32Notice: curl_setopt(): CURLOPT_SSL_VERIFYHOST with value 1 is deprecated and will be removed as of libcurl 7.28.1. It is recommended to use value 2 instead in %s on line %d
33bool(true)
34bool(true)
35