feat/mtls-support-cert: config support

This commit is contained in:
progressive-kiwi
2025-04-01 20:43:42 +02:00
parent 435b638701
commit b41570eb2c
4 changed files with 49 additions and 30 deletions

View File

@@ -321,13 +321,8 @@ func main() {
}
var opt websocket.ClientOption
if tlsPrivateKey != "" {
tlsConfig, err := websocket.LoadClientCertificate(tlsPrivateKey)
if err != nil {
logger.Fatal("Failed to load client certificate: %v", err)
}
opt = websocket.WithTLSConfig(tlsConfig)
opt = websocket.WithTLSConfig(tlsPrivateKey)
}
// Create a new client
client, err := websocket.NewClient(
id, // CLI arg takes precedence