multiple client CAs

This commit is contained in:
a10zn8
2023-07-12 00:03:37 +04:00
parent eab870f7eb
commit 6c49e19a2b
8 changed files with 37 additions and 16 deletions

View File

@@ -78,7 +78,7 @@ class TlsSetupSpec extends Specification {
certificate: "127.0.0.1.crt",
key: "127.0.0.1.p8.key",
clientRequire: true,
clientCa: "ca.myhost.dev.crt"
clientCAs: ["ca.myhost.dev.crt"]
)
when:
def act = tlsSetup.setupServer("test", config, false)
@@ -182,12 +182,12 @@ class TlsSetupSpec extends Specification {
certificate: "127.0.0.1.crt",
key: "127.0.0.1.p8.key",
clientRequire: true,
clientCa: "none.crt"
clientCAs: ["none.crt"]
)
when:
tlsSetup.setupServer("test", config, false)
then:
def t = thrown(IllegalArgumentException)
def t = thrown(FileNotFoundException)
}
def "Fail if client certificate is invalid"() {
@@ -197,11 +197,11 @@ class TlsSetupSpec extends Specification {
certificate: "127.0.0.1.crt",
key: "127.0.0.1.p8.key",
clientRequire: true,
clientCa: "ca.myhost.dev.key"
clientCAs: ["ca.myhost.dev.key"]
)
when:
tlsSetup.setupServer("test", config, false)
then:
def t = thrown(IllegalArgumentException)
def t = thrown(java.security.cert.CertificateParsingException)
}
}

View File

@@ -72,6 +72,6 @@ class AuthConfigReaderSpec extends Specification {
act.key == "/etc/client1.myservice.com.key"
act.clientRequire != null
!act.clientRequire
act.clientCa == "/etc/ca.myservice.com.crt"
act.clientCAs == ["/etc/ca.myservice.com.crt"]
}
}

View File

@@ -39,7 +39,7 @@ class MainConfigReaderSpec extends Specification {
certificate == "/path/127.0.0.1.crt"
key == "/path/127.0.0.1.p8.key"
!clientRequire
clientCa == "/path/ca.dshackle.test.crt"
clientCAs == ["/path/ca.dshackle.test.crt"]
}
act.cache != null
with(act.cache) {