-
Notifications
You must be signed in to change notification settings - Fork 17
martian(mitm): fix connect error response propagation #966
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before: $ curl -k -v -x localhost:3128 https://www.google.com * Host localhost:3128 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:3128... * Connected to localhost (::1) port 3128 * CONNECT tunnel: HTTP/1.1 negotiated * allocate connect buffer * Establish HTTP proxy tunnel to www.google.com:443 > CONNECT www.google.com:443 HTTP/1.1 > Host: www.google.com:443 > User-Agent: curl/8.7.1 > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < * CONNECT phase completed * CONNECT tunnel established, response 200 * ALPN: curl offers h2,http/1.1 * (304) (OUT), TLS handshake, Client hello (1): * (304) (IN), TLS handshake, Server hello (2): * (304) (IN), TLS handshake, Unknown (8): * (304) (IN), TLS handshake, Certificate (11): * (304) (IN), TLS handshake, CERT verify (15): * (304) (IN), TLS handshake, Finished (20): * (304) (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF * ALPN: server accepted http/1.1 * Server certificate: * subject: O=Forwarder Proxy MITM; CN=www.google.com * start date: Nov 25 12:31:19 2024 GMT * expire date: Nov 27 12:31:19 2024 GMT * issuer: C=US; O=Sauce Labs Inc. * SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway. * using HTTP/1.x > GET / HTTP/1.1 > Host: www.google.com > User-Agent: curl/8.7.1 > Accept: */* > * Request completely sent off < HTTP/1.1 500 Internal Server Error < Content-Length: 55 < Content-Type: text/plain; charset=utf-8 < X-Forwarder-Error: forwarder Not Modified < forwarder encountered an unexpected error Not Modified * Connection #0 to host localhost left intact After: $ curl -k -v -x localhost:3128 https://www.google.com * Host localhost:3128 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:3128... * Connected to localhost (::1) port 3128 * CONNECT tunnel: HTTP/1.1 negotiated * allocate connect buffer * Establish HTTP proxy tunnel to www.google.com:443 > CONNECT www.google.com:443 HTTP/1.1 > Host: www.google.com:443 > User-Agent: curl/8.7.1 > Proxy-Connection: Keep-Alive > < HTTP/1.1 200 OK < * CONNECT phase completed * CONNECT tunnel established, response 200 * ALPN: curl offers h2,http/1.1 * (304) (OUT), TLS handshake, Client hello (1): * (304) (IN), TLS handshake, Server hello (2): * (304) (IN), TLS handshake, Unknown (8): * (304) (IN), TLS handshake, Certificate (11): * (304) (IN), TLS handshake, CERT verify (15): * (304) (IN), TLS handshake, Finished (20): * (304) (OUT), TLS handshake, Finished (20): * SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256 / [blank] / UNDEF * ALPN: server accepted http/1.1 * Server certificate: * subject: O=Forwarder Proxy MITM; CN=www.google.com * start date: Nov 25 12:47:26 2024 GMT * expire date: Nov 27 12:47:26 2024 GMT * issuer: C=US; O=Sauce Labs Inc. * SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway. * using HTTP/1.x > GET / HTTP/1.1 > Host: www.google.com > User-Agent: curl/8.7.1 > Accept: */* > * Request completely sent off < HTTP/1.1 304 Not Modified < Accept-Ranges: bytes < Access-Control-Allow-Credentials: true < Cache-Control: public, max-age=0 < Content-Encoding: gzip < Content-Type: text/css; charset=UTF-8 < Date: Mon, 19 Aug 2024 22:25:39 GMT < Etag: W/"113bc-191043002c8" < Last-Modified: Tue, 30 Jul 2024 15:09:01 GMT < Server: monocle/0.24.1 < Strict-Transport-Security: max-age=15552000; includeSubDomains < Vary: Origin < * Connection #0 to host localhost left intact Fixes #510
Allow asserting any given response.
d5e4894 to
dc825e6
Compare
Enable TestProxyBadGateway in all cases.
dc825e6 to
9476da1
Compare
Choraden
reviewed
Nov 27, 2024
Choraden
approved these changes
Nov 27, 2024
Contributor
Choraden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #510