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

mac bigsur下使用openssl无法发起https请求,换LibreSSL则正常

Open qq690712575 opened this issue 4 years ago • 11 comments

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a simple script for reproducing the error.

当我使用openssl编译swoole时候,发起https请求会报错,协程退出。报错 [2021-02-19 21:54:07 $27867.0] WARNING swManager_check_exit_status: worker#8[pid=28403] abnormal exit, status=0, signal=10

  1. What did you expect to see?

我希望请求别人的https接口

  1. What did you see instead? 日志不停报错,并无法发出请求 [2021-02-19 21:54:07 $27867.0] WARNING swManager_check_exit_status: worker#8[pid=28403] abnormal exit, status=0, signal=10 最后的解决方法和引起的原因 openssl => LibreSSL 3.2.4 #这里原来我是用openssl 1.1.1j来编译的就会报错,换了LibreSSL则一切正常

  2. What version of Swoole are you using (show your php --ri swoole)?

swoole

Swoole => enabled Author => Swoole Team [email protected] Version => 4.4.23 Built => Feb 20 2021 01:04:34 coroutine => enabled kqueue => enabled rwlock => enabled openssl => LibreSSL 3.2.4 #这里原来我是用openssl 1.1.1j来编译的就会报错,换了LibreSSL则一切正常 pcre => enabled zlib => 1.2.11 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 => On => On swoole.unixsock_buffer_size => 262144 => 262144 driverMacBook-Pro:md_easyswoole chenlaosiji$

  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ? MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64 PHP 7.4.9 (cli) (built: Aug 31 2020 14:42:45) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 12.0.0 (clang-1200.0.32.29) Target: x86_64-apple-darwin20.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

qq690712575 avatar Feb 19 '21 17:02 qq690712575

我尝试切换php版本和swoole版本都无法解决,只有切换openssl 为 LibreSSL 则可以

qq690712575 avatar Feb 19 '21 17:02 qq690712575

这可能是 openssl 存在 bug,SIG 10 表示 SIGBUS,在 arm64 平台,这可能是使用了未对齐的内存指针

matyhtf avatar Feb 20 '21 15:02 matyhtf

我的机器是macbookpro2019 amd64平台

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: 韩天峰-Rangomailto:[email protected] 发送时间: 2021年2月20日 23:33 收件人: swoole/swoole-srcmailto:[email protected] 抄送: Jianle Chenmailto:[email protected]; Authormailto:[email protected] 主题: Re: [swoole/swoole-src] mac bigsur下使用openssl无法发起https请求,换LibreSSL则正常 (#4064)

这可能是 openssl 存在 bug,SIG 10 表示 SIGBUS,在 arm64 平台,这可能是使用了未对齐的内存指针

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fswoole%2Fswoole-src%2Fissues%2F4064%23issuecomment-782699300&data=04%7C01%7C%7Cef0bb596a36a456e27af08d8d5b4e81c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637494320254342187%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=1VUC%2FgFWsqKAeABC7Omt95St2eDqtdXCVRU6yAVqH1M%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEHBFI7GS72J6DPYEDYOGWLS77I5PANCNFSM4X4XCLYQ&data=04%7C01%7C%7Cef0bb596a36a456e27af08d8d5b4e81c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637494320254342187%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LZpxNvKCknchAtlCkzvRUEU%2FouoSrkMgy8xZSOEqbfc%3D&reserved=0.

qq690712575 avatar Feb 21 '21 12:02 qq690712575

Run

brew reinstall openssl
pecl install -a --nobuild swoole \
    && cd "$(pecl config-get temp_dir)/swoole" \
    && phpize \
    && ./configure --with-openssl-dir=/usr/local/Cellar/[email protected]/1.1.1j --enable-sockets --enable-openssl --enable-http2 --enable-mysqlnd \
    && make \
    && make install \
    && echo "extension=\"swoole.so\"" >> $(php -i | grep "php.*php.ini" | rev | cut -d' ' -f1 | rev)

works for me on BigSur :-)

juslintek avatar Feb 22 '21 10:02 juslintek

Thank you,now my swoole is running on bigsur .Next time I will try to used reinstall openssl for build the swoole.

获取 Outlook for Androidhttps://aka.ms/ghei36


From: Linas [email protected] Sent: Monday, February 22, 2021 6:14:30 PM To: swoole/swoole-src [email protected] Cc: Jianle Chen [email protected]; Author [email protected] Subject: Re: [swoole/swoole-src] mac bigsur下使用openssl无法发起https请求,换LibreSSL则正常 (#4064)

Run

brew reinstall openssl pecl install -a --nobuild swoole
&& cd "$(pecl config-get temp_dir)/swoole"
&& phpize
&& ./configure --enable-sockets --enable-openssl --enable-http2 --enable-mysqlnd
&& make
&& make install
&& echo "extension=swoole.so" >> $(php -i | grep "php.*php.ini" | rev | cut -d' ' -f1 | rev)

works for me on BigSur :-)

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fswoole%2Fswoole-src%2Fissues%2F4064%23issuecomment-783261029&data=04%7C01%7C%7C83b0a6ed86614387832508d8d71aa566%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495856729299424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=l3x7tboiqPe08uWh%2BRY3%2FOL2z2x32RutRHqHmYCLPjM%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEHBFI6PZYA2LJP433ZDAADTAIVANANCNFSM4X4XCLYQ&data=04%7C01%7C%7C83b0a6ed86614387832508d8d71aa566%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637495856729299424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=bUgOFulO3UU4dgBB42C%2FaaUP%2BnXYcTsPlA20c%2Fr5PnI%3D&reserved=0.

qq690712575 avatar Feb 22 '21 17:02 qq690712575

在bigsur安装swoole是不是不能用系统自带的php?

kajweb avatar Feb 25 '21 07:02 kajweb

在bigsur安装swoole是不是不能用系统自带的php?

可以啊,以前我就是用这个,后面我改了

qq690712575 avatar Mar 02 '21 08:03 qq690712575

在bigsur安装swoole是不是不能用系统自带的php?

bigsur 刚发布的时候使用自带的php加载扩展会提示需要签名.

zuozhehao avatar Mar 08 '21 07:03 zuozhehao

现在我的电脑是找不到相关的lib

kajweb avatar Mar 08 '21 07:03 kajweb

我尝试切换php版本和swoole版本都无法解决,只有切换openssl 为 LibreSSL 则可以

我想请教一下,如何切换为LibreSSl😄

yishengzhishui avatar Apr 18 '21 12:04 yishengzhishui

编译的时候 指定openssl的位置为libressl的位置即可

发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用

发件人: @.> 发送时间: 2021年4月18日 20:26 收件人: @.> 抄送: Jianle @.>; @.> 主题: Re: [swoole/swoole-src] mac bigsur下使用openssl无法发起https请求,换LibreSSL则正常 (#4064)

我尝试切换php版本和swoole版本都无法解决,只有切换openssl 为 LibreSSL 则可以

我想请教一下,如何切换为LibreSSl😄

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fswoole%2Fswoole-src%2Fissues%2F4064%23issuecomment-821983794&data=04%7C01%7C%7C15d1a93668234cd83cbf08d902652baf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637543455812385591%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=HotJ1ezsK1Ez1x7TBdK5HFt8Yjz4xcMoP7%2FPXkq6lIE%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEHBFI2CG2JI466TLWWLVRLTJLFWVANCNFSM4X4XCLYQ&data=04%7C01%7C%7C15d1a93668234cd83cbf08d902652baf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637543455812385591%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SAuX0h5cLTO%2BS1uDgWGlTNPk2fgtCy7wt2P6AJDozJY%3D&reserved=0.

qq690712575 avatar Apr 18 '21 12:04 qq690712575