Skip to content

Network online test using https broken #8396

Closed
@evrinoma

Description

@evrinoma

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions