Perl 6 Cro的存根不运行:请求HTTP/2,但不支持ALPN

12 perl6 cro raku

我使用Perl 6的cro创建了一个存根服务,但由于"不支持ALPN"而导致错误.

$ cro stub http ds4 ds4
Stubbing a HTTP Service 'ds4' in 'ds4'...

First, please provide a little more information.

Secure (HTTPS) (yes/no) [no]: yes
Support HTTP/1.1 (yes/no) [yes]: 
Support HTTP/2.0 (yes/no) [yes]: 
Support Web Sockets (yes/no) [no]: yes

$ cd ds4
$ cro run
? Starting ds4 (ds4)
 Endpoint HTTPS will be at https://localhost:20000/
? Restarting ds4 (ds4)
? ds4 HTTP/2 is requested, but ALPN is not supported
? ds4   in method new at /home/zoffix/rakudo/install/share/perl6/site/sources/D142088174DCE80630FC7C31793703D9D56E26D6 (Cro::HTTP::Server) line 128
? ds4   in block <unit> at service.p6 line 5
? ds4 
Run Code Online (Sandbox Code Playgroud)

我搜索了这个错误,但我得到的是有关重建nginx和Apache的信息,我没有使用它.它提到了libssl以及我所拥有的这个相当古老的安装libssl1.0.0:i386,libssl0.9.8:i386并且没有更新的软件包.

手动编译新的libssl可能会解决我遇到的问题吗?


更新:假设我确实正确安装了较新的libssl,问题仍然存在:

$ cd $(mktemp -d)
$ wget https://www.openssl.org/source/openssl-1.1.1-pre6.tar.gz
$ tar -xvvf *
$ cd open*
$ ./config && make
$ make
$ sudo make install

...

$ zef uninstall Cro::Core Cro::HTTP cro Cro::TLS Cro::WebSocket OpenSSL IO::Socket::SSL IO::Socket::SSL::Async
$ zef install --/test cro
$ cro run
? Starting ds4 (ds4)
 Endpoint HTTPS will be at https://localhost:20000/
? Restarting ds4 (ds4)
? ds4 HTTP/2 is requested, but ALPN is not supported
? ds4   in method new at /home/zoffix/rakudo/install/share/perl6/site/sources/AA08D168A5945413FFDA254577A6F6FF64F66989 (Cro::HTTP::Server) line 128
? ds4   in block <unit> at service.p6 line 5
? ds4 
Run Code Online (Sandbox Code Playgroud)

tim*_*imo 12

将新.so文件安装到系统通常需要更新ld缓存; apt,rpm和friends都会在需要时自动在安装后挂钩中执行此操作,但是当您手动安装库时,可能必须手动执行.

执行此操作的命令是

sudo ldconfig

希望有所帮助!

  • 那很简单!确实,在运行`sudo ldconfig``cro run`开始正常工作之后,现在我在浏览器中看到了该页面! (2认同)