Add condition to cert in sentry
Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
parent
a2377a84b9
commit
c27e013b39
|
|
@ -33,13 +33,17 @@ type Sentry struct {
|
||||||
|
|
||||||
// NewSentry creates a Sentry client from the provided Data Source Name (DSN)
|
// NewSentry creates a Sentry client from the provided Data Source Name (DSN)
|
||||||
func NewSentry(certPool *x509.CertPool, dsn string) (*Sentry, error) {
|
func NewSentry(certPool *x509.CertPool, dsn string) (*Sentry, error) {
|
||||||
client, err := sentry.NewClient(sentry.ClientOptions{
|
var tr *http.Transport
|
||||||
Dsn: dsn,
|
if certPool != nil {
|
||||||
HTTPTransport: &http.Transport{
|
tr = &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
RootCAs: certPool,
|
RootCAs: certPool,
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
}
|
||||||
|
client, err := sentry.NewClient(sentry.ClientOptions{
|
||||||
|
Dsn: dsn,
|
||||||
|
HTTPTransport: tr,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue