mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-18 08:20:56 +00:00
Implement custom logger with log levels
This commit is contained in:
19
internal/tls_provider/tls_provider.go
Normal file
19
internal/tls_provider/tls_provider.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user