From efc98fb6c49678e823da56486182a0e247a15b96 Mon Sep 17 00:00:00 2001 From: Torben Burchgart Date: Mon, 9 Sep 2024 13:35:55 +0200 Subject: [PATCH] Add key alias support for SSL context configuration Implement functionality to specify a key alias for the SSL context, enhancing flexibility in managing multiple keys. Update relevant documentation to reflect these changes and ensure consistent usage across the application. --- .../predic8/membrane/core/transport/ssl/SSLContextTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/com/predic8/membrane/core/transport/ssl/SSLContextTest.java b/core/src/test/java/com/predic8/membrane/core/transport/ssl/SSLContextTest.java index e823cc072..67f955a56 100644 --- a/core/src/test/java/com/predic8/membrane/core/transport/ssl/SSLContextTest.java +++ b/core/src/test/java/com/predic8/membrane/core/transport/ssl/SSLContextTest.java @@ -107,7 +107,7 @@ public void selectFirstKeyAndPass() throws Exception { @Test public void selectFirstKeyTrustFail() { - assertThrows(SocketException.class, () -> { + assertThrows2(SocketException.class, SSLHandshakeException.class, () -> { SSLContext server = cb().withKeyStore("classpath:/alias-keystore.p12").byKeyAlias("key2").build(); SSLContext client = cb().withTrustStore("classpath:/alias-truststore.p12").build(); testCombination(server, client); @@ -123,7 +123,7 @@ public void selectSecondKeyAndPass() throws Exception { @Test public void selectSecondKeyTrustFail() { - assertThrows(SocketException.class, () -> { + assertThrows2(SocketException.class, SSLHandshakeException.class, () -> { SSLContext server = cb().withKeyStore("classpath:/alias-keystore.p12").byKeyAlias("key1").build(); SSLContext client = cb().withTrustStore("classpath:/alias-truststore2.p12").build(); testCombination(server, client);