Bug #77749 [Opn->Nab]: OpenSSL and alert protocol version
| From: | cmb@php.net | Date: | Sat, 16 Mar 2019 10:08:16 +0000 |
| Subject: | Bug #77749 [Opn->Nab]: OpenSSL and alert protocol version | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220000@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77749&edit=1
ID: 77749
Updated by: cmb@php.net
Reported by: lodashes at gmail dot com
Summary: OpenSSL and alert protocol version
-Status: Open
+Status: Not a bug
Type: Bug
Package: *Network Functions
Operating System: Windows7, Linux Mint
PHP Version: 7.3.3
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2019-03-16 08:36:33] lodashes at gmail dot com
Problem in stream_get_contents, you must use fgets,fgetc,stream_socket_recvfrom to read data, but
now i get encrypted data looks like
>bÃev��h����$��q*�zhP#, how to get normal data
string?
------------------------------------------------------------------------
[2019-03-15 18:10:37] lodashes at gmail dot com
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77749&edit=1