bug78775.phpt 652 B

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