[fix](sdk) Enable TLS certificate verification by default in Go SDK#64925
Open
arpitjain099 wants to merge 1 commit into
Open
[fix](sdk) Enable TLS certificate verification by default in Go SDK#64925arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
The HTTP client in the Go SDK hardcodes InsecureSkipVerify: true, which disables TLS certificate verification for all connections. This exposes database credentials to man-in-the-middle attacks on any Go SDK client connection (CWE-295). This patch enables TLS verification by default and adds an InsecureSkipVerify option to the Config struct for environments where self-signed certificates are expected. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
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
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.
What problem does this PR solve?
Issue Number: close #64570
Related PR: N/A
Problem Summary:
The Go SDK HTTP client (
pkg/load/util/http_client.go) hardcodesInsecureSkipVerify: truein its default TLS configuration. All SDK API calls, including those carrying authentication credentials, skip TLS certificate verification. This exposes Doris database credentials to man-in-the-middle attacks on any Go SDK client connection (CWE-295).The fix enables TLS verification by default (the Go standard library default behavior) and adds a configurable
InsecureSkipVerifyfield toConfigfor environments that use self-signed certificates.Since
InsecureSkipVerifyis abool, its zero value isfalse, so existing callers that don't set the field get the secure default without code changes.Release note
Fixed a security issue in the Go SDK where TLS certificate verification was disabled by default, exposing credentials to potential MITM attacks. TLS verification is now enabled by default. Users who need to connect to Doris clusters with self-signed certificates can set
InsecureSkipVerify: truein theirConfig.Check List (For Author)
Test
http_client_test.gostill passes (it useshttptest.NewServerwhich is plain HTTP, so TLS config is not exercised). TheInsecureSkipVerifyfield was also removed from the test helper since it is not needed for the HTTP test server.Behavior changed:
InsecureSkipVerify: truein their SDK config to maintain the previous behavior.Does this need documentation?
InsecureSkipVerifyconfig field should be documented in the Go SDK README.