@Test
    public void testWaitUntilReadyWithTimeoutCausedBySslHandshakeError() {
        try (
            GenericContainer<?> container = new GenericContainer<>(
                new ImageFromDockerfile()
                    .withFileFromClasspath("Dockerfile", "https-wait-strategy-dockerfile/Dockerfile")
                    .withFileFromClasspath("nginx-ssl.conf", "https-wait-strategy-dockerfile/nginx-ssl.conf")
            )
                .withExposedPorts(8443)
                .waitingFor(
                    createHttpWaitStrategy(ready)
                        .forPort(8443)
                        .usingTls()
                        .withStartupTimeout(Duration.ofMillis(WAIT_TIMEOUT_MILLIS))
                )
        ) {
            Throwable throwable = Assertions.catchThrowable(container::start);
            assertThat(throwable).hasStackTraceContaining("javax.net.ssl.SSLHandshakeException");
        }
    }
Test to validate fix from GitHub Pull Request <a href="https://github.com/testcontainers/testcontainers-java/pull/5778">#5778</a>, i.e. when the container startup fails (ContainerLaunchException) before timeout for some reason, we are able to see the root cause of the error in the stack trace, e.g. in this case, a TLS certificate validation error during the TLS handshake test, because we are using a NGINX docker image with self-signed certificate created with the image, that is obviously not trusted.
The exceptions we should see in the stacktrace ('/' means 'caused by'): ContainerLaunchException / TimeoutException / RuntimeException / SSLHandshakeException / ValidatorException (in sun.* package so not accessible) / SunCertPathBuilderException (in sun.* package so not accessible).
core/src/test/java/org/testcontainers/junit/wait/strategy/HttpWaitStrategyTest.java