MCPcopy
hub / github.com/yusing/godoxy / TestExtraCertKeyPathsUnique

Function TestExtraCertKeyPathsUnique

internal/autocert/config_test.go:40–62  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

38}
39
40func TestExtraCertKeyPathsUnique(t *testing.T) {
41 t.Run("duplicate cert_path rejected", func(t *testing.T) {
42 cfg := &autocert.Config{
43 Provider: autocert.ProviderLocal,
44 Extra: []autocert.ConfigExtra{
45 {CertPath: "a.crt", KeyPath: "a.key"},
46 {CertPath: "a.crt", KeyPath: "b.key"},
47 },
48 }
49 require.Error(t, cfg.Validate())
50 })
51
52 t.Run("duplicate key_path rejected", func(t *testing.T) {
53 cfg := &autocert.Config{
54 Provider: autocert.ProviderLocal,
55 Extra: []autocert.ConfigExtra{
56 {CertPath: "a.crt", KeyPath: "a.key"},
57 {CertPath: "b.crt", KeyPath: "a.key"},
58 },
59 }
60 require.Error(t, cfg.Validate())
61 })
62}
63
64func TestCertificateKeyType(t *testing.T) {
65 t.Run("default is EC256 in lego config", func(t *testing.T) {

Callers

nothing calls this directly

Calls 2

ValidateMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected