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

Http proxy tls fix (fixes #6) #7

Conversation

tebruno99
Copy link

Original PR: gorilla#782 by @sleeyax

Previously, it was impossible to specify both Proxy and NetDialTLSContext on the websocket Dialer without experiencing connection issues. This commit brings a change to the proxy CONNECT flow so that the initial connection is always a normal proxy CONNECT over TCP, while allowing TLS customizations on the existing connection at a later point in time via the new ProxyTLSConnection method.

Fixes gorilla#779 #6

Summary of Changes

Please see my comment on the relevant issue for a detailed explanation and my thought process: gorilla#779 (comment)

Tests are not included, I'd appreciate some help or guidance on that front because I'm unsure what to test, thanks!

Removed the call to NetDialTLSContext from the HTTP proxy CONNECT step and replaced it with a regular net.Dial in order to prevent connection issues. Custom TLS connections can now be made via the new optional ProxyTLSConnection method, after the proxy connection has been successfully established.
@tebruno99 tebruno99 self-assigned this Dec 13, 2022
@tebruno99 tebruno99 merged commit 78e2b14 into ElasticPerch:bugfix/6-bug-cant-establish-websocket-connection-when-using-netdialtlscontext-and-proxy-together Dec 13, 2022
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

Successfully merging this pull request may close these issues.

2 participants