MCPcopy
hub / github.com/sideshow/apns2 / TestClientNameToCertificate

Function TestClientNameToCertificate

client_test.go:116–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestClientNameToCertificate(t *testing.T) {
117 crt, _ := certificate.FromP12File("certificate/_fixtures/certificate-valid.p12", "")
118 client := apns.NewClient(crt)
119 name := client.HTTPClient.Transport.(*http2.Transport).TLSClientConfig.NameToCertificate
120 assert.Len(t, name, 1)
121
122 certificate2 := tls.Certificate{}
123 client2 := apns.NewClient(certificate2)
124 name2 := client2.HTTPClient.Transport.(*http2.Transport).TLSClientConfig.NameToCertificate
125 assert.Len(t, name2, 0)
126}
127
128func TestDialTLSTimeout(t *testing.T) {
129 apns.TLSDialTimeout = 10 * time.Millisecond

Callers

nothing calls this directly

Calls 2

FromP12FileFunction · 0.92
LenMethod · 0.80

Tested by

no test coverage detected