xref: /PHP-7.2/ext/curl/tests/bug78775.phpt (revision 4f984a2f)
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 (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
7?>
8--FILE--
9<?php
10
11$sock = fsockopen("tls://google.com", 443);
12
13var_dump($sock);
14
15$handle = curl_init('https://self-signed.badssl.com/');
16curl_setopt_array(
17    $handle,
18    [
19        CURLOPT_RETURNTRANSFER => true,
20        CURLOPT_SSL_VERIFYPEER => true,
21    ]
22);
23
24var_dump(curl_exec($handle));
25curl_close($handle);
26
27fwrite($sock, "GET / HTTP/1.0\n\n");
28var_dump(fread($sock, 8));
29
30?>
31--EXPECTF--
32resource(%d) of type (stream)
33bool(false)
34string(8) "HTTP/1.0"
35