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

时间:2018-05-15 12:33:56

标签: perl6 raku cro

我使用Perl 6创建了一个存根服务,但由于“不支持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 

我搜索了这个错误,但我得到的是重建nginx和Apache的信息,我没有使用。它提到了libssl,在这个相当古老的安装中,我有libssl1.0.0:i386libssl0.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 

1 个答案:

答案 0 :(得分:12)

将新的var HabJax = HabJax || function() { "use strict"; if(window.location.hash) { HabJax.handle_ajax(); } window.addEventListener("hashchange", function(){ HabJax.handle_ajax(); }, false); return this; }; window.onload = function(){ this.HabJax = new HabJax(); } HabJax.prototype = { page: null, self: this, hotelBase: 'http://localhost/Ajax/', handle_ajax: function() { var query_string = window.location.hash; query_string = query_string.substr(1); query_string = query_string.substr(1); if(query_string != 'index' && query_string != '0' && query_string != '' && query_string != null) { $.ajax({ type: "POST", url: this.hotelBase + query_string, success: function(data) { $("#contentInner").slideUp('fast', function() { $("#content").html(data); $("#contentInner").slideDown('slow'); }); HabJax.initialize(); } }); } else { window.location.hash = '!1'; } }, initialize: function() { console.log('HabJax: Initialized (Page: ' + this.getPage() + ')'); this.page = this.getPage(); this.executePageFunctionalities(this.page); window.onhashchange = function() { HabJax.page = HabJax.getPage(); HabJax.executePageFunctionalities(HabJax.page); } return true; }, getPage: function() { var page = location.href, pageName, action; if (page.indexOf('&') != -1) { pageName = page.substring(page.lastIndexOf('/') + 1, page.indexOf('&')); } else if(page.indexOf('#') != -1) { pageName = page.substring(page.lastIndexOf('/') + 1, page.indexOf('#')); pageName = pageName.substring(0, pageName.length - 1).slice(2); } else { pageName = page.substring(page.lastIndexOf('/') + 1); } return (pageName == '' ? '0' : pageName); }, executePageFunctionalities: function(page) { switch (page) { case null: case '0': console.log('HabJax Index: Initialized'); break; case '1': console.log('HabJax Me: Initialized'); this.Me.init(); break; case '2': console.log('HabJax Test: Initialized'); break; } }, 文件安装到系统通常需要更新.so的缓存; apt,rpm和朋友都会在需要时自动在安装后挂钩中执行此操作,但是当您手动安装库时,可能必须手动执行。

执行此操作的命令是

ld

希望有所帮助!