MCPcopy Create free account
hub / github.com/cloudflare/cfssl / TestNewMutualTLSServer

Function TestNewMutualTLSServer

api/client/client_test.go:90–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestNewMutualTLSServer(t *testing.T) {
91 cert, _ := helpers.LoadClientCertificate("../../helpers/testdata/ca.pem", "../../helpers/testdata/ca_key.pem")
92 s := NewServerTLS("https://nohost:8888", helpers.CreateTLSConfig(nil, cert))
93 if s == nil {
94 t.Fatalf("fatal error, empty server")
95 }
96 _, err := s.Sign([]byte{5, 5, 5, 5})
97 if err == nil {
98 t.Fatalf("expected error with sign function")
99 }
100 if !(strings.Contains(err.Error(), "Post")) && !(strings.Contains(err.Error(), "https://nohost:8888/api/v1/cfssl/sign")) && !(strings.Contains(err.Error(), "dial tcp: lookup nohost: no such host")) {
101 t.Fatalf("no error message %v", err)
102 }
103}
104
105func TestNewServerGroup(t *testing.T) {
106 s := NewServer("cfssl1.local:8888, cfssl2.local:8888, http://cfssl3.local:8888, http://cfssl4.local:8888")

Callers

nothing calls this directly

Calls 5

LoadClientCertificateFunction · 0.92
CreateTLSConfigFunction · 0.92
NewServerTLSFunction · 0.85
SignMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…