Skip to content
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

MacOS(M1/M2)协程 HTTP 客服端报“SSL verify failed” #5130

Open
huangdijia opened this issue Aug 17, 2023 · 1 comment
Open

MacOS(M1/M2)协程 HTTP 客服端报“SSL verify failed” #5130

huangdijia opened this issue Aug 17, 2023 · 1 comment

Comments

@huangdijia
Copy link

huangdijia commented Aug 17, 2023

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.
$client = new \Swoole\Coroutine\Http\Client($host = 'www.qq.com', 443, true);
    $client->setHeaders([
        'Host' => $host,
        'User-Agent' => 'Chrome/49.0.2587.3',
        'Accept' => 'text/html,application/xhtml+xml,application/xml',
        'Accept-Encoding' => 'gzip',
    ]);
    $client->set([
        'ssl_verify_peer' => true, // 注释掉这里就正常
        'ssl_allow_self_signed' => true,
        'ssl_host_name' => $host,
    ]);
    $client->get('/');
    var_dump(
        $client->statusCode,
        $client->body,
        $client->errCode,
        $client->errMsg
    );
    $client->close();
  1. What did you expect to see?

返回正常的信息

  1. What did you see instead?

openssl 1.1

int(-1)
string(0) ""
int(1014)
string(17) "SSL verify failed"

openssl 3

 64839 segmentation fault  php test.php
  1. What version of Swoole are you using (show your php --ri swoole)?
php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 5.0.2
Built => Aug 11 2023 10:18:14
coroutine => enabled with boost asm context
kqueue => enabled
rwlock => enabled
openssl => OpenSSL 1.1.1u  30 May 2023
dtls => enabled
http2 => enabled
json => enabled
curl-native => enabled
pcre => enabled
zlib => 1.2.12
mysqlnd => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => Off => Off
swoole.unixsock_buffer_size => 262144 => 262144
  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
uname -a

Darwin MacBook-Air.local 23.0.0 Darwin Kernel Version 23.0.0: Tue Aug  1 03:25:17 PDT 2023; root:xnu-10002.0.242.0.6~31/RELEASE_ARM64_T8103 arm64
php -v

PHP 8.1.22 (cli) (built: Aug  1 2023 16:16:09) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.22, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.22, Copyright (c), by Zend Technologies
gcc -v

Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
@leocavalcante
Copy link
Member

If it helps:
Screenshot 2023-08-17 at 11 15 06
Maybe something with ARM arch indeed.

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

No branches or pull requests

2 participants