Bug #73450 [Opn->Spm]: built on

From: Date: Thu, 03 Nov 2016 07:59:37 +0000
Subject: Bug #73450 [Opn->Spm]: built on
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205167@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73450&edit=1

 ID:                 73450
 Updated by:         requinix@php.net
 Reported by:        admin at angosso dot net
 Summary:            built on
-Status:             Open
+Status:             Spam
 Type:               Bug
 Package:            Dynamic loading
 Operating System:   string 'Linux' (length=5)
 PHP Version:        7.0.12
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2016-11-03 07:11:36] admin at angosso dot net

Description:
------------
Compiler PHP avec l'option de configuration --with-openssl[=DIR].

Test script:
---------------
<?php
echo php_uname();
echo PHP_OS;

/* Some possible outputs:
Linux exemple.net 2.4.21-0.13mdk #1 Thu Oct 06 15:08:06 EST 2016 i686
Linux
{https://www.exemple.net}/includes/openssl/{headerfile}
HIS IS WRONG --with-openssl=/var/www/vhosts/exemple.net/.../includes/openssl 
THIS IS RIGHT --with-openssl=/var/www/vhosts/exemple.net/.../
$host = 'www.exemple.net';
$data = 'user=redacted&pass=redacted&action=redacted';
$response = "";

if ( $fp = fsockopen("ssl:{$host}", 443, $errno, $errstr, 30) ) {

    $msg  = 'POST /wsAPI.php HTTP/1.1' . "\r\n";
    $msg .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
    $msg .= 'Content-Length: ' . strlen($data) . "\r\n";
    $msg .= 'Host: ' . $host . "\r\n";
    $msg .= 'Connection: close' . "\r\n\r\n";
    $msg .= $data;
    if ( fwrite($fp, $msg) ) {
        while ( !feof($fp) ) {
            $response .= fgets($fp, 1024);
        }
    }
    fclose($fp);

} else {
    $response = false;
}
if ($fp = fsockopen('ssl://'. $host, 443, $errno, $errstr, 30)) {

Expected result:
----------------
<?php
$fp = stream_socket_client("tcp://www.example.net:8443", $errno, $errstr, 30);
if (!$fp) {
    die("Unable to connect: $errstr ($errno)");
}

/* Turn on encryption for login phase */
stream_socket_enable_crypto($fp, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
fwrite($fp, "USER god\r\n");
fwrite($fp, "PASS secret\r\n");

/* Turn off encryption for the rest */
stream_socket_enable_crypto($fp, false);

while ($motd = fgets($fp)) {
    echo $motd;
}
tcp://www.example.net
udp://www.example.net
ssl://www.example.net
sslv2://www.example.net
sslv3://www.example.net
tls://www.example.net
fclose($fp);
?>



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73450&edit=1


Thread (2 messages)

« previous php.bugs (#205167) next »