Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sentry

import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io"
Expand Down Expand Up @@ -229,6 +230,8 @@ type ClientOptions struct {
// This will default to the HTTPS_PROXY environment variable.
// HTTPS_PROXY takes precedence over HTTP_PROXY for https requests.
HTTPSProxy string
// An optional tls config.
TlsConfig *tls.Config
// An optional set of SSL certificates to use.
CaCerts *x509.CertPool
// MaxErrorDepth is the maximum number of errors reported in a chain of errors.
Expand Down
4 changes: 3 additions & 1 deletion transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ func getProxyConfig(options ClientOptions) func(*http.Request) (*url.URL, error)
}

func getTLSConfig(options ClientOptions) *tls.Config {
if options.CaCerts != nil {
if options.TlsConfig != nil {
return options.TlsConfig
} else if options.CaCerts != nil {
// #nosec G402 -- We should be using `MinVersion: tls.VersionTLS12`,
// but we don't want to break peoples code without the major bump.
return &tls.Config{
Expand Down