Created
March 13, 2019 18:34
-
-
Save undercloud/d246473370aec7f19c2e42414ae00693 to your computer and use it in GitHub Desktop.
streams.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$nl = "\r\n"; | |
$headers = ( | |
"GET / HTTP/1.1" . $nl . | |
"Host: www.ssllabs.com". $nl . | |
"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0". $nl . | |
"Content-Length: 0". $nl . | |
"Connection: close". $nl . | |
$nl | |
); | |
$context = stream_context_create([ | |
'ssl' => [ | |
'verify_peer_name' => false, | |
'verify_peer' => false | |
] | |
]); | |
$f = stream_socket_client('ssl://64.41.200.100:443',$a,$b,30,STREAM_CLIENT_CONNECT,$context); | |
var_dump(stream_socket_sendto($f,$headers)); | |
echo stream_get_contents($f); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
int(165)
WARNING stream_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1409442E:SSL routines:SSL3_READ_BYTES:tlsv1 alert protocol version on line number 24