Open linzhanglong opened 6 months ago
please provide detailed steps to reproduce. I just gave it a try and it works:
create following route:
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT \
-H "X-API-KEY: ${ADMIN_API_KEY}" \
-d '{
"uri": "/post",
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:443": 1
},
"scheme": "https"
}
}'
send a request with Transfer-Encoding: chunked
header:
curl "http://127.0.0.1:9080/post" -X POST -vvv \
-H "transfer-encoding: chunked" \
-d "asdfgwuierhw9rghad98ghqwe98gqhwre9g8h9hd9vqhwe98ghqwe98ghwg" \
-i
Note: Unnecessary use of -X or --request, POST is already inferred.
Trying 127.0.0.1:9080...
Connected to 127.0.0.1 (127.0.0.1) port 9080
POST /post HTTP/1.1 Host: 127.0.0.1:9080 User-Agent: curl/8.4.0 Accept: / transfer-encoding: chunked Content-Type: application/x-www-form-urlencoded
< HTTP/1.1 200 OK HTTP/1.1 200 OK < Content-Type: application/json Content-Type: application/json < Content-Length: 523 Content-Length: 523 < Connection: keep-alive Connection: keep-alive < Date: Fri, 05 Jan 2024 10:05:00 GMT Date: Fri, 05 Jan 2024 10:05:00 GMT < Access-Control-Allow-Origin: Access-Control-Allow-Origin: < Access-Control-Allow-Credentials: true Access-Control-Allow-Credentials: true < Server: APISIX/3.7.0 Server: APISIX/3.7.0
< { "args": {}, "data": "", "files": {}, "form": { "asdfgwuierhw9rghad98ghqwe98gqhwre9g8h9hd9vqhwe98ghqwe98ghwg": "" }, "headers": { "Accept": "/", "Content-Length": "59", "Content-Type": "application/x-www-form-urlencoded", "Host": "127.0.0.1", "User-Agent": "curl/8.4.0", "X-Amzn-Trace-Id": "Root=1-6597d44c-569a751f418e33f73f5d3ec1", "X-Forwarded-Host": "127.0.0.1" }, "json": null, "origin": "127.0.0.1, 163.47.148.18", "url": "https://127.0.0.1/post" }
Hi @shreemaan-abhishek , i think @linzhanglong excepts https://127.0.0.1:9443/post chunked transfer works normal
Yes, chunked transfer works normally with HTTP, but not with HTTPS. When testing the request through Postman tool, under the HTTPS, the request remains at the "Transfer Start" phase until the transfer is complete. However, under HTTP, the "Transfer Start" phase finishes quickly, and most of the time is spent in the "Download" phase.
Hello, The proxy_buffering off; can solve the issue, but why doesn't HTTP have this problem (maybe transfer size diff)? and can it apply only a route by plugin? @shreemaan-abhishek
@linzhanglong @hanqingwu @shreemaan-abhishek I want to work on this issue I have tried checking based on above details. Correct me If I am wrong
Request
curl "http://127.0.0.1:9080/post" -X POST -vvv \ -H "transfer-encoding: chunked" \ -d "asdfgwuierhw9rghad98ghqwe98gqhwre9g8h9hd9vqhwe98ghqwe98ghwg" \ -i
Response
{ "args": {}, "data": "", "files": {}, "form": { "asdfgwuierhw9rghad98ghqwe98gqhwre9g8h9hd9vqhwe98ghqwe98ghwg": "" }, "headers": { "Accept": "/", "Content-Length": "59", "Content-Type": "application/x-www-form-urlencoded", "Host": "127.0.0.1", "User-Agent": "curl/7.84.0", "X-Amzn-Trace-Id": "Root=1-659a76fd-6b45a62f3a0678c265b0a3d5", "X-Forwarded-Host": "127.0.0.1" }, "json": null, "origin": "172.20.0.1, 49.205.40.78", "url": "https://127.0.0.1/post" }
USING HTTP
Request
curl "https://127.0.0.1:9080/post" -X POST -vvv -H "transfer-encoding: chunked" -d "asdfgwuierhw9rghad98ghqwe98gqhwre9g8h9hd9vqhwe98ghqwe98ghwg" -i
Response
error:1408F10B:SSL routines:ssl3_get_record:wrong version number
Are you sending https(https://127.0.0.1:9080/post) request on http port(http://127.0.0.1:9080/post) ? @Abhijeetmishr
Are you sending https(https://127.0.0.1:9080/post) request on http port(http://127.0.0.1:9080/post) ? @Abhijeetmishr
I think so not sure, okay got it that is why it is giving SSL certificate error both http and https runs on diff ports
@linzhanglong can you confirm if you have http2 enabled in your apisix config? https://github.com/shreemaan-abhishek/apisix/blob/3a48d17889cf1283e63a6e2b44ed33ab07dc4588/conf/config-default.yaml#L99
Current Behavior
If using HTTP, it works normally.
Expected Behavior
using HTTPS, it can works normally
Error Logs
no error
Steps to Reproduce
Request header:
request payload:
Environment
apisix version
): 3.4.2uname -a
): Linux master-01 4.18.0-372.19.1.49.po1.x86_64 #1 SMP Tue Apr 18 02:53:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linuxopenresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):