summaryrefslogtreecommitdiff
path: root/ext/curl/tests/bug78775.phpt
blob: 490c16816659d939d382595159e50486e17e3360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Bug #78775: TLS issues from HTTP request affecting other encrypted connections
--SKIPIF--
<?php
if (!extension_loaded('curl')) die('skip Requires curl');
if (getenv('SKIP_ONLINE_TESTS')) die('skip Online test');
?>
--FILE--
<?php

$sock = fsockopen("tls://google.com", 443);

var_dump($sock);

$handle = curl_init('https://self-signed.badssl.com/');
curl_setopt_array(
    $handle,
    [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_SSL_VERIFYPEER => true,
    ]
);

var_dump(curl_exec($handle));
curl_close($handle);

fwrite($sock, "GET / HTTP/1.0\n\n");
var_dump(fread($sock, 8));

?>
--EXPECTF--
resource(%d) of type (stream)
bool(false)
string(8) "HTTP/1.0"