Skip to content

Network online test using https broken #8396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
evrinoma opened this issue Apr 18, 2022 · 2 comments
Closed

Network online test using https broken #8396

evrinoma opened this issue Apr 18, 2022 · 2 comments

Comments

@evrinoma
Copy link

evrinoma commented Apr 18, 2022

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

@cmb69
Copy link
Member

cmb69 commented Apr 19, 2022

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 cmb69 reopened this Apr 26, 2022
@bukka bukka changed the title test broken after build Network online test using https broken after build Aug 2, 2022
@bukka bukka changed the title Network online test using https broken after build Network online test using https broken Aug 2, 2022
@bukka bukka closed this as completed in dc01fce Aug 2, 2022
@bukka
Copy link
Member

bukka commented Aug 2, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants