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

http2简单的get请求报错absolutely wrong message #2316

Open
muyilangjun1 opened this issue Jul 13, 2023 · 3 comments
Open

http2简单的get请求报错absolutely wrong message #2316

muyilangjun1 opened this issue Jul 13, 2023 · 3 comments

Comments

@muyilangjun1
Copy link

Describe the bug (描述bug)
http2 简单的get请求报错

To Reproduce (复现方法)
1、编译master版本example下的http_c++
2、运行命令 ./http_client --http_verbose=1 --protocol=h2 https://fapi.binance.com/fapi/v1/time
3、即使代码里加上options.mutable_ssl_options();也一样报错

root@tomo6:/home/ubuntu/brpc/example/http_c++# ./http_client --http_verbose=1 --protocol=h2 https://fapi.binance.com/fapi/v1/time
I0713 02:00:56.035332 3436 src/brpc/policy/http2_rpc_protocol.cpp:1800]
[ H2 REQUEST @172.31.9.191 ]

:method = GET
:scheme = https
:path = /fapi/v1/time
:authority = fapi.binance.com
accept = /
user-agent = brpc/1.0 curl/7.0

E0713 02:00:56.040389 3444 src/brpc/policy/http2_rpc_protocol.cpp:450] Too large frame length=4740180 max=16384
W0713 02:00:56.040512 3444 src/brpc/input_messenger.cpp:247] Close Socket{id=1 fd=3 addr=54.178.200.31:443:53516} (0x563cd6665800): absolutely wrong message
[E22]Close Socket{id=1 fd=3 addr=54.178.200.31:443:53516} (0x0x563cd6665800): absolutely wrong message

Expected behavior (期望行为)
正常返回{"serverTime":1689213610168},和去掉protocol=h2一样

Versions (各种版本)
OS: ubuntu 20.4
Compiler:gcc g++
brpc:-DBRPC_REVISION="1.5.0|master|af899d7b|2023-07-10T13:06:03+08:00"
protobuf:

Additional context/screenshots (更多上下文/截图)

@leaf-potato
Copy link
Contributor

server端可能开启了alpn协商,默认处理http协议,不具备协议自动识别能力。
需要SSL扩展进行协商才能通过h2访问,详见#1991 中的nginx例子

@muyilangjun1
Copy link
Author

恩,看了一下#1991issue,是不是意味着需要等框架支持alpn后才支持这样调用?

@leaf-potato
Copy link
Contributor

恩,看了一下#1991issue,是不是意味着需要等框架支持alpn后才支持这样调用?

嗯,是这样的

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