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