mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-24 04:55:28 +02:00
[misc] Separate shared code dependencies (#4288)
* Separate shared code dependencies * Fix import * Test respective shared code * Update openapi ref * Fix test * Fix test path
This commit is contained in:
26
shared/relay/tls/client_dev.go
Normal file
26
shared/relay/tls/client_dev.go
Normal file
@@ -0,0 +1,26 @@
|
||||
//go:build devcert
|
||||
|
||||
package tls
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/netbirdio/netbird/util/embeddedroots"
|
||||
)
|
||||
|
||||
func ClientQUICTLSConfig() *tls.Config {
|
||||
certPool, err := x509.SystemCertPool()
|
||||
if err != nil || certPool == nil {
|
||||
log.Debugf("System cert pool not available; falling back to embedded cert, error: %v", err)
|
||||
certPool = embeddedroots.Get()
|
||||
}
|
||||
|
||||
return &tls.Config{
|
||||
InsecureSkipVerify: true, // Debug mode allows insecure connections
|
||||
NextProtos: []string{nbalpn}, // Ensure this matches the server's ALPN
|
||||
RootCAs: certPool,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user