Launch
This commit is contained in:
22
internal/dnsttclient/certpool.go
Normal file
22
internal/dnsttclient/certpool.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package dnsttclient
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
)
|
||||
|
||||
func loadTLSConfig() (*tls.Config, error) {
|
||||
pool, err := x509.SystemCertPool()
|
||||
if err != nil {
|
||||
pool = nil
|
||||
}
|
||||
|
||||
config := &tls.Config{
|
||||
MinVersion: tls.VersionTLS12,
|
||||
}
|
||||
if pool != nil {
|
||||
config.RootCAs = pool
|
||||
}
|
||||
|
||||
return config, nil
|
||||
}
|
||||
Reference in New Issue
Block a user