17 lines
334 B
Go
17 lines
334 B
Go
package dtlsdial
|
|
|
|
import "testing"
|
|
|
|
func TestGenerateSelfSignedCert(t *testing.T) {
|
|
cert, err := GenerateSelfSignedCert()
|
|
if err != nil {
|
|
t.Fatalf("GenerateSelfSignedCert: %v", err)
|
|
}
|
|
if len(cert.Certificate) == 0 {
|
|
t.Fatal("certificate chain is empty")
|
|
}
|
|
if cert.PrivateKey == nil {
|
|
t.Fatal("private key is nil")
|
|
}
|
|
}
|