xref: /PHP-7.4/ext/curl/tests/bug78775.phpt (revision 1aa419dc)
1--TEST--
2Bug #78775: TLS issues from HTTP request affecting other encrypted connections
3--SKIPIF--
4<?php
5if (!extension_loaded('curl')) die('skip Requires curl');
6if (!extension_loaded('openssl')) die('skip Requires openssl');
7if (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
8?>
9--FILE--
10<?php
11
12$sock = fsockopen("tls://google.com", 443);
13
14var_dump($sock);
15
16$handle = curl_init('https://self-signed.badssl.com/');
17curl_setopt_array(
18    $handle,
19    [
20        CURLOPT_RETURNTRANSFER => true,
21        CURLOPT_SSL_VERIFYPEER => true,
22    ]
23);
24
25var_dump(curl_exec($handle));
26curl_close($handle);
27
28fwrite($sock, "GET / HTTP/1.0\n\n");
29var_dump(fread($sock, 8));
30
31?>
32--EXPECTF--
33resource(%d) of type (stream)
34bool(false)
35string(8) "HTTP/1.0"
36