fix(dtlsdial): унифицировать генерацию self-signed сертификата
Добавляет dtlsdial.GenerateSelfSignedCert() как единственное место создания self-signed сертификата. cmd/server теперь использует его вместо прямого импорта selfsign; Dialer.Dial уже использовал ленивый путь certOnce, который внутри зовёт ту же функцию.
This commit is contained in:
1 parent
14376016aa
commit
ef549dc2b8
2 files changed
+9
-2
No files matched your search
@@ -14,6 +14,13 @@ import (
|
||||
"github.com/pion/dtls/v3/pkg/crypto/selfsign"
|
||||
)
|
||||
|
||||
// GenerateSelfSignedCert returns a new self-signed TLS certificate for use
|
||||
// as the DTLS identity. It is a thin wrapper around selfsign.GenerateSelfSigned
|
||||
// and exists so both cmd/server and Dialer share one call-site.
|
||||
func GenerateSelfSignedCert() (tls.Certificate, error) {
|
||||
return selfsign.GenerateSelfSigned()
|
||||
}
|
||||
|
||||
// Dialer configures the DTLS client handshake.
|
||||
type Dialer struct {
|
||||
// HandshakeTimeout caps the handshake context. Zero means no timeout.
|
||||
|
||||
Reference in new issue
Block a user