php-src icon indicating copy to clipboard operation
php-src copied to clipboard

Network online test using https broken

Open evrinoma opened this issue 4 years ago • 2 comments

Description

Hi. I try to build php engine from source code and I've got an error Bug #80067 (Omitting the port in bindto setting errors) [ext/standard/tests/network/bug80067.phpt]

I tried to solve the problem by I built openssl.so and ran the test with openssl lib inside the ext/standard folder, and the test was fine. Also I faced with strange name config.m4 inside the ext/openssl folder, that's why I couldn't run phpize fine to solve this problem I've renamed config0.m4 to config.m4

The following code:

--TEST--
Bug #80067 (Omitting the port in bindto setting errors)
--SKIPIF--
<?php
if (getenv("SKIP_ONLINE_TESTS")) die('skip online test');
?>
--FILE--
<?php
$context = stream_context_create(['socket' => ['bindto' => '0']]);
var_dump(file_get_contents('https://httpbin.org/get', false, $context) !== false);
?>
--EXPECT--
bool(true)

Resulted in this output:

Bug #80067 (Omitting the port in bindto setting errors) [ext/standard/tests/network/bug80067.phpt]

Actually it looks strange trying to run test without openssl support, and it should be disabled

The following code instead:

--TEST--
Bug #80067 (Omitting the port in bindto setting errors)
--SKIPIF--
<?php
if (getenv("SKIP_ONLINE_TESTS")) die('skip online test');
if (!in_array('https', stream_get_wrappers())) die('skip: https wrapper is required');
?>
--FILE--
<?php
$context = stream_context_create(['socket' => ['bindto' => '0']]);
var_dump(file_get_contents('https://httpbin.org/get', false, $context) !== false);
?>
--EXPECT--
bool(true)

Resulted in this output:

bool(true)

build params ./configure' '--build=x86_64' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--enable-option-checking=fatal' '--with-mhash' '--disable-all' '--with-pic' '--with-password-argon2' '--with-zlib' '--enable-xml' '--with-libxml' '--disable-phpdbg' '--with-pear' '--disable-cgi' '--enable-fpm' '--with-fpm-user=www-data' '--with-fpm-group=www-data' 'build_alias=x86_64'

PHP Version

PHP 7.4.29

Operating System

REHL

evrinoma avatar Apr 18 '22 18:04 evrinoma

Actually it looks strange trying to run test without openssl support, and it should be disabled

Ah, right. I think a lot more tests are affected by this, though.

Also I faced with strange name config.m4 inside the ext/openssl folder, that's why I couldn't run phpize fine to solve this problem I've renamed config0.m4 to config.m4

OpenSSL's config.m4 is called config0.m4 to be read very early during in-tree builds. I'm not sure that this is still necessary, since important parts of the configuration have been moved to the core.

cmb69 avatar Apr 19 '22 08:04 cmb69

So the skip was added by Levi but the test was still failing for me because it relies on system cert store which it shouldn't so that got fixed as well now.

bukka avatar Aug 02 '22 17:08 bukka