mirror of
https://github.com/pikami/cosmium.git
synced 2024-11-29 00:47:44 +00:00
20 lines
380 B
Go
20 lines
380 B
Go
|
package tlsprovider
|
||
|
|
||
|
import (
|
||
|
"crypto/tls"
|
||
|
|
||
|
"github.com/pikami/cosmium/internal/logger"
|
||
|
)
|
||
|
|
||
|
func GetDefaultTlsConfig() *tls.Config {
|
||
|
cert, err := tls.X509KeyPair([]byte(certificate), []byte(certificateKey))
|
||
|
if err != nil {
|
||
|
logger.Error("Failed to parse certificate and key:", err)
|
||
|
return &tls.Config{}
|
||
|
}
|
||
|
|
||
|
return &tls.Config{
|
||
|
Certificates: []tls.Certificate{cert},
|
||
|
}
|
||
|
}
|