-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: self signed certificate handling in v7.7.0 #2803
fix: self signed certificate handling in v7.7.0 #2803
Conversation
pkg/validation/options.go
Outdated
transport.TLSClientConfig = &tls.Config{ | ||
RootCAs: pool, | ||
MinVersion: tls.VersionTLS12, | ||
} | ||
|
||
http.DefaultClient = &http.Client{Transport: transport} | ||
requests.DefaultHTTPClient = &http.Client{Transport: transport} |
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.
This breaks the user agent handling
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.
requests.DefaultHTTPClient = &http.Client{Transport: transport} | |
requests.DefaultHTTPClient.Next = transport |
pkg/requests/http.go
Outdated
@@ -7,20 +7,22 @@ import ( | |||
) | |||
|
|||
type userAgentTransport struct { | |||
next http.RoundTripper | |||
Next http.RoundTripper |
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.
Instead of exposing Next maybe a setter like function would be a better idea
Description
PR #2570 introduced a custom user-agent for oauth2-proxy when making requests to the configured identity provider. This introduced custom
http.Client
andhttp.Transport
handling. Which wasn't reflected in the whole code base. Therefore with v7.7.0 the custom SSL handling for private CAs--provider-ca-files
or allowing insecure connections--ssl-insecure-skip-verify
didn't have any effect anymore because they were trying to configure golangshttp.DefaultClient
instead of our custom http client.Furthermore, I checked the whole code base for custom transport settings and think I got all related to this custom
http.Client
.Fixes #2802
How Has This Been Tested?
--provider-ca-files
--ssl-insecure-skip-verify
oauth2-proxy/<version>
Checklist: