Allow tls certificates skipping
This commit is contained in:
@ -2,6 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"net/http"
|
||||
|
||||
"gitlab.com/wpetit/goweb/logger"
|
||||
"gitlab.com/wpetit/goweb/template/html"
|
||||
@ -65,6 +67,20 @@ func getServiceContainer(ctx context.Context, conf *config.Config) (*service.Con
|
||||
conf.HTTP.TemplateDir,
|
||||
))
|
||||
|
||||
defaultHTTPTransport, ok := http.DefaultTransport.(*http.Transport)
|
||||
if ok {
|
||||
if defaultHTTPTransport.TLSClientConfig == nil {
|
||||
defaultHTTPTransport.TLSClientConfig = &tls.Config{}
|
||||
}
|
||||
|
||||
defaultHTTPTransport.TLSClientConfig.InsecureSkipVerify = conf.OIDC.InsecureSkipVerify
|
||||
} else {
|
||||
logger.Fatal(
|
||||
ctx,
|
||||
"could not configure default http client",
|
||||
)
|
||||
}
|
||||
|
||||
// Create and expose config service provider
|
||||
ctn.Provide(config.ServiceName, config.ServiceProvider(conf))
|
||||
|
||||
|
Reference in New Issue
Block a user