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

Disallow configuring a custom root CA with a custom RoundTripper #593

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yec-akamai
Copy link
Contributor

📝 Description

Disallow that presenting custom root CA and custom http transport together. Print a warning and return when this happens.

✔️ How to Test

make testunit

@yec-akamai yec-akamai added the improvement for improvements in existing functionality in the changelog. label Oct 24, 2024
@yec-akamai yec-akamai requested a review from a team as a code owner October 24, 2024 18:06
@yec-akamai yec-akamai requested review from lgarber-akamai and ykim-1 and removed request for a team October 24, 2024 18:06
@@ -743,6 +744,11 @@ func NewClient(hc *http.Client) (client Client) {
log.Fatalf("[ERROR] Error when reading cert at %s: %s\n", certPath, err.Error())
}

if hc.Transport != http.DefaultTransport.(*http.Transport) {
log.Println("[WARN] Custom transport is not allowed with a custom root CA.")
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to break this logic out into a separate function so the Client can still finish initializing if this condition is met?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement for improvements in existing functionality in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants