Allow users to define what extensions CA certs will have (#120)
* 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
3dc3b09a8e
commit
ea8e48f3b8
3 changed files with 75 additions and 22 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{}{".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