aze2201 / lua-mitm-proxy

Man in Middle (attack) in OpenResty
2 stars 0 forks source link

error: client sent invalid request while reading client request line #1

Open wzzcanoe opened 4 months ago

wzzcanoe commented 4 months ago

Hello there,

I cloned the repository and started the proxy successfully. However, when I curl websites with this proxy, I encounter an error:

lua-mitm-proxy | 2024/05/28 02:53:27 [info] 7#7: *16 client sent invalid request while reading client request line, client: 172.20.0.1, server: $host, request: "CONNECT portal.cae.asiainfo-sec.com:443 HTTP/1.1"
lua-mitm-proxy | 172.20.0.1 - - [28/May/2024:02:53:27 +0000] "CONNECT portal.cae.asiainfo-sec.com:443 HTTP/1.1" 400 163 "-" "-"   

Here is the curl info:

# curl https://portal.cae.asiainfo-sec.com --proxy-insecure --proxy https://localhost:443
curl: (56) Received HTTP code 400 from proxy after CONNECT

Thank you for your assistance.

aze2201 commented 4 months ago

Hello. Project uses NGINX+LUA. And unfortunately NGINX does not support the CONNECT method. NGINX does not officially support the HTTP CONNECT method

Because the CONNECT method scenario for certificate exchange is different. Also, please make sure curl refers to the right pre-installed certificate and refers to that signed certificate. Normally browsers does it. But curl not sure.

On Tue, May 28, 2024 at 5:02 AM django wang @.***> wrote:

Hello there,

I cloned the repository and started the proxy successfully. However, when I curl websites with this proxy, I encounter an error: lua-mitm-proxy | 2024/05/28 02:53:27 [info] 7#7: *16 client sent invalid request while reading client request line, client: 172.20.0.1, server: $host, request: "CONNECT portal-dev.cae.asiainfo-sec.com:443 HTTP/1.1" lua-mitm-proxy | 172.20.0.1 - - [28/May/2024:02:53:27 +0000] "CONNECT portal-dev.cae.asiainfo-sec.com:443 HTTP/1.1" 400 163 "-" "-" Here is the curl info:

curl https://portal.cae.asiainfo-sec.com --proxy-insecure --proxy

https://localhost:443 curl: (56) Received HTTP code 400 from proxy after CONNECT Thank you for your assistance.

— Reply to this email directly, view it on GitHub https://github.com/aze2201/lua-mitm-proxy/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOMAEAX6RYRYHWW5C7V23DZEPXSVAVCNFSM6AAAAABIMBNMJ6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZDAMBTGAYDAOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- BR