Allow users to define what extensions CA certs will have. Skip any files that don't have the right extension.
This commit is contained in:
parent
3fa2a20fe4
commit
6cdcbcb5db
3 changed files with 67 additions and 21 deletions
12
util_test.go
12
util_test.go
|
@ -100,3 +100,15 @@ func TestCurrentBatchCalculator(t *testing.T) {
|
|||
assert.Equal(t, 0, curBatch)
|
||||
})
|
||||
}
|
||||
|
||||
func TestCertPoolCreator(t *testing.T) {
|
||||
extensions := map[string]struct{}{"key": {}, "pem": {}, "crt": {}}
|
||||
|
||||
_, err := createCertPool("examples/certs", extensions)
|
||||
assert.NoError(t, err)
|
||||
|
||||
t.Run("badDir", func(t *testing.T) {
|
||||
_, err := createCertPool("idontexist", extensions)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue