|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-03-16 08:36 UTC] lodashes at gmail dot com
[2019-03-16 10:08 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2019-03-16 10:08 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 21:00:01 2025 UTC |
Description: ------------ Hello! I can’t set up working with a secure connection, I cannot determine the cause of the error, maybe I have incorrectly configured the context of the SSL options and I need to specify additional parameters? I tried version 7.2 but the error was the same, I tried to connect to different https servers - failed, connect fails but data exchange fails, I tried to ask a question on the forum - I was told that the reason for the protocol mismatch and it is outdated, I hope YOU help me figure it out, please! Test script: --------------- $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); Expected result: ---------------- Valid HTTP Response Actual result: -------------- 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 19