Skip to content

Commit

Permalink
Temporally disabled integration tests which relay on badssl.com certi…
Browse files Browse the repository at this point in the history
…ficates. they are expired and need to be updated
  • Loading branch information
Hakky54 committed Nov 28, 2021
1 parent a05f2cb commit c6860d6
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
<version>${version.maven-fail-safe}</version>
<configuration>
<useModulePath>false</useModulePath>
<excludedGroups>it-with-badssl.com</excludedGroups>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
import org.apache.http.impl.client.HttpClients;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

Expand All @@ -38,9 +37,8 @@
*/
class SSLFactoryIT {

private static final Logger LOGGER = LoggerFactory.getLogger(SSLFactoryIT.class);

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthentication() throws IOException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.hc.core5.http.HttpResponse;
import org.apache.hc.core5.http.Method;
import org.apache.hc.core5.http.nio.support.BasicRequestProducer;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import java.io.IOException;
Expand All @@ -52,6 +53,7 @@
class SSLFactoryIT {

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthentication() throws IOException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down Expand Up @@ -85,6 +87,7 @@ void executeHttpsRequestWithMutualAuthentication() throws IOException {
}

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthenticationForAsyncClient() throws IOException, URISyntaxException, InterruptedException, ExecutionException, TimeoutException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -34,6 +35,7 @@
class SSLFactoryIT {

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthentication() throws Exception {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import nl.altindag.log.LogCaptor;
import nl.altindag.ssl.util.KeyStoreUtils;
import nl.altindag.ssl.util.NettySslUtils;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;
import reactor.netty.http.client.HttpClient;
Expand All @@ -37,6 +38,7 @@
class SSLFactoryIT {

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthentication() throws IOException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import nl.altindag.log.LogCaptor;
import nl.altindag.ssl.util.KeyStoreUtils;
import nl.altindag.ssl.util.PemUtils;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import javax.net.ssl.HttpsURLConnection;
Expand All @@ -38,6 +39,7 @@ class SSLFactoryIT {
private static final char[] IDENTITY_PASSWORD = "badssl.com".toCharArray();

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthentication() throws IOException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down Expand Up @@ -67,6 +69,7 @@ void executeHttpsRequestWithMutualAuthentication() throws IOException {
}

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthenticationWithUnencryptedPrivateKey() throws IOException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down Expand Up @@ -96,6 +99,7 @@ void executeHttpsRequestWithMutualAuthenticationWithUnencryptedPrivateKey() thro
}

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthenticationFromRawSslMaterial() throws IOException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import nl.altindag.ssl.util.KeyStoreUtils;
import nl.altindag.ssl.util.SSLSessionUtils;
import nl.altindag.ssl.util.TrustManagerUtils;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

import javax.net.ssl.HttpsURLConnection;
Expand Down Expand Up @@ -54,6 +55,7 @@
class SSLFactoryIT {

@Test
@Tag("it-with-badssl.com")
void executeHttpsRequestWithMutualAuthentication() throws IOException {
LogCaptor logCaptor = LogCaptor.forName("nl.altindag.ssl");

Expand Down Expand Up @@ -128,6 +130,7 @@ void executeRequestToTwoServersWithMutualAuthenticationWithSingleHttpClientAndSi
}

@Test
@Tag("it-with-badssl.com")
void executeRequestToTwoServersWithMutualAuthenticationWithReroutingClientCertificates() throws IOException {
ExecutorService executorService = Executors.newSingleThreadExecutor();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;

Expand Down Expand Up @@ -65,6 +66,7 @@ static void setUpSSLSocketFactory() {

@Test
@Order(1)
@Tag("it-with-badssl.com")
void executeHttpsRequestWithSslSocketFactoryContainingBadSslKeyManager() throws IOException {
HttpsURLConnection connection = (HttpsURLConnection) new URL("https://client.badssl.com/").openConnection();
connection.setSSLSocketFactory(sslSocketFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;

Expand Down Expand Up @@ -65,6 +66,7 @@ static void setUpSSLSocketFactory() {

@Test
@Order(1)
@Tag("it-with-badssl.com")
void executeHttpsRequestWithSslSocketFactoryContainingBadSslTrustManager() throws IOException {
HttpsURLConnection connection = (HttpsURLConnection) new URL("https://client.badssl.com/").openConnection();
connection.setSSLSocketFactory(sslSocketFactory);
Expand All @@ -82,6 +84,7 @@ void executeHttpsRequestWithSslSocketFactoryContainingBadSslTrustManager() throw

@Test
@Order(2)
@Tag("it-with-badssl.com")
void executeHttpsRequestWithExistingSslSocketFactoryContainingASwappedUnsafeTrustManager() throws IOException {
TrustManagerUtils.swapTrustManager(trustManager, TrustManagerUtils.createUnsafeTrustManager());
SSLSessionUtils.invalidateCaches(sslSessionContext);
Expand Down

0 comments on commit c6860d6

Please sign in to comment.