Skip to content

Commit

Permalink
v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gematik-Entwicklung authored and RStaeber committed May 6, 2024
1 parent 3e7312a commit 794797c
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 38 deletions.
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

# Release notes PKI Test Suite

## Release 3.0.0

- ANFPKI-21: distinguish between different SocketException messages in case of aborted TLS handshake
- update dependencies

## Release 2.5.1

- update dependencies
Expand Down
4 changes: 2 additions & 2 deletions pkits-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-common</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<name>Common Code</name>
<description>Common code</description>

Expand Down
4 changes: 2 additions & 2 deletions pkits-coverage-reports/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-coverage-reports</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<packaging>pom</packaging>

<name>Code Coverage Reports</name>
Expand Down
4 changes: 2 additions & 2 deletions pkits-distro-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-distro-assembly</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<packaging>pom</packaging>

<name>Distribution</name>
Expand Down
4 changes: 2 additions & 2 deletions pkits-ocsp-responder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-ocsp-responder</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<name>OCSP Responder Simulator</name>
<description>Spring Boot OCSP Responder</description>

Expand Down
4 changes: 2 additions & 2 deletions pkits-sut-server-sim/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-sut-server-sim</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<name>Test Object Simulator (Server)</name>
<description>Test object simulator (server)</description>

Expand Down
6 changes: 3 additions & 3 deletions pkits-testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<name>PKI Test Suite</name>
<description>PKI test suite</description>

Expand All @@ -28,7 +28,7 @@
<!-- dependencies -->
<version.commons-lang3>3.14.0</version.commons-lang3>
<version.apache.sshd>2.12.1</version.apache.sshd>
<version.itextpdf.html2pdf>5.0.3</version.itextpdf.html2pdf>
<version.itextpdf.html2pdf>5.0.4</version.itextpdf.html2pdf>
<version.jaxb-runtime>4.0.1</version.jaxb-runtime>
<version.mockito>5.11.0</version.mockito>
<version.picocli>4.7.5</version.picocli>
Expand Down
4 changes: 2 additions & 2 deletions pkits-tls-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-tls-client</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>

<name>TLS Client</name>
<description>TLS Client</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public static int connectTls(
return 2;
} catch (final UnknownHostException e) {
log.info("Host unknown: {}", ipAddressOrFqdn);
log.info("returning 2...");
return 2;
} catch (final IOException
| UnrecoverableKeyException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.InputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -131,10 +132,51 @@ private void tlsConnect(

log.info("algorithm: {}, ciphersSuites: {}", algorithm, Arrays.asList(ciphersSuites));

log.info("Try to connect with cert \"{}\"", clientKeystorePath);
try (final SSLSocket clientSSLSocket =
(SSLSocket) sslContextClient.getSocketFactory().createSocket()) {
log.info("Try to connect with cert \"{}\"", clientKeystorePath);
// Attempt to establish the connection
sslConnect(serverAddress, serverPort, clientSSLSocket, ciphersSuites);
// Start the handshake
sslHandshake(clientSSLSocket);
} catch (final IOException e) {
log.info("IOException: {}", e.getMessage());
throw new TlsClientException("IOException: socket creation error.", e);
}
}

private static void sslHandshake(final SSLSocket clientSSLSocket)
throws IOException, TlsConnectionException, TlsClientException {
try {
log.info(
"Starting handshake from: {} to remote server socket: {}...",
clientSSLSocket.getLocalSocketAddress(),
clientSSLSocket.getRemoteSocketAddress());
clientSSLSocket.startHandshake();
log.info(
"...handshake successfully started. To send application data implement:"
+ " clientSSLSocket.getOutputStream().write()");
} catch (final TlsFatalAlertReceived | SocketTimeoutException e) {
log.info("No ssl connection established: {}", e.getMessage());
throw new TlsConnectionException("No ssl connection established.", e);
} catch (final SocketException e) {
log.info("SocketException: {}", e.getMessage());
if (e.getMessage().startsWith("Connection refused")) {
throw new TlsClientException("SocketException: Connection refused.", e);
} else {
throw new TlsConnectionException(
"No ssl connection established. SocketException: " + e.getMessage(), e);
}
}
}

private void sslConnect(
final InetAddress serverAddress,
final int serverPort,
final SSLSocket clientSSLSocket,
final String[] ciphersSuites)
throws TlsClientException {
try {
final SSLParameters sslParameters = clientSSLSocket.getSSLParameters();
sslParameters.setCipherSuites(ciphersSuites);
clientSSLSocket.setSSLParameters(sslParameters);
Expand All @@ -149,20 +191,10 @@ private void tlsConnect(
ocspDelaySeconds);
clientSSLSocket.connect(
new InetSocketAddress(serverAddress, serverPort), ocspDelaySeconds * 1000);
log.info("...connection successful.");
log.info(
"Starting handshake from: {} to remote server socket: {}...",
clientSSLSocket.getLocalSocketAddress(),
clientSSLSocket.getRemoteSocketAddress());
clientSSLSocket.startHandshake();
log.info(
"...handshake successfully started. To send application data implement:"
+ " clientSSLSocket.getOutputStream().write()");
} catch (final TlsFatalAlertReceived | SocketTimeoutException e) {
log.info("No ssl connection established: {}", e.getMessage());
throw new TlsConnectionException("No ssl connection established.", e);
log.info("... socket connect successful.");
} catch (final IOException e) {
throw new TlsClientException("Problems creating or using client SSL socket.", e);
log.info("IOException: {}", e.getMessage());
throw new TlsClientException("SSLSocket connection error.", e);
}
}
}
4 changes: 2 additions & 2 deletions pkits-tsl-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-tsl-generator</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<name>PKI TSL Generator</name>
<description>PKI TSL Generator</description>

Expand Down
4 changes: 2 additions & 2 deletions pkits-tsl-provider/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
</parent>

<artifactId>pkits-tsl-provider</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<name>TSL Server Simulator</name>
<description>Spring Boot TSL Provider</description>

Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>de.gematik.pki.pkits</groupId>
<artifactId>pki-testsuite</artifactId>
<version>2.5.1</version>
<version>3.0.0</version>
<packaging>pom</packaging>
<name>PKI Testsuite</name>
<description>PKI Testsuite to test products of the telematic infrastructure to fulfill the
Expand Down Expand Up @@ -92,16 +92,16 @@
<version.commons-io>2.16.1</version.commons-io>
<version.commons-text>1.12.0</version.commons-text>
<version.jfiglet>1.0.1</version.jfiglet>
<version.gemLibPki>2.1.3</version.gemLibPki>
<version.jackson>2.17.0</version.jackson>
<version.gemLibPki>2.1.4</version.gemLibPki>
<version.jackson>2.17.1</version.jackson>
<version.jakarta.annotation-api>3.0.0</version.jakarta.annotation-api>
<version.junit-jupiter>5.10.2</version.junit-jupiter>
<version.junit-platform-launcher>1.10.2</version.junit-platform-launcher>
<version.log4j2>2.23.1</version.log4j2>
<version.lombok>1.18.32</version.lombok>
<version.openapi>2.5.0</version.openapi>
<version.unirest-java>3.14.5</version.unirest-java>
<version.xmlunit>2.9.1</version.xmlunit>
<version.xmlunit>2.10.0</version.xmlunit>

<!-- plugins -->
<version.dependency-check-maven>7.2.1</version.dependency-check-maven>
Expand All @@ -111,7 +111,7 @@
<version.maven-assembly-plugin>3.6.0</version.maven-assembly-plugin>
<version.maven-clean-plugin>3.3.2</version.maven-clean-plugin>
<version.maven-compiler-plugin>3.13.0</version.maven-compiler-plugin>
<version.maven-deploy-plugin>3.1.1</version.maven-deploy-plugin>
<version.maven-deploy-plugin>3.1.2</version.maven-deploy-plugin>
<version.maven-enforcer-plugin>3.4.1</version.maven-enforcer-plugin>
<version.maven-failsafe-plugin>${version.maven-surefire-plugin}</version.maven-failsafe-plugin>
<version.maven-project-info-reports-plugin>3.5.0</version.maven-project-info-reports-plugin>
Expand Down

0 comments on commit 794797c

Please sign in to comment.