| 38 | } |
| 39 | |
| 40 | func 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 | |
| 64 | func TestCertificateKeyType(t *testing.T) { |
| 65 | t.Run("default is EC256 in lego config", func(t *testing.T) { |