Skip to content

Commit

Permalink
Use correct ports for MTLS native test
Browse files Browse the repository at this point in the history
Native runs in prod profile and so doesn't use the set test ports,
need to explicitly use the same port as would be used in prod. Currently hardcoded though.

Use different method to include resources, specify all jks rather than using resource file.

Fix import order

Correct algorithm used in keystores, can't use DSA in Java 11+
  • Loading branch information
CSTDev committed Nov 4, 2019
1 parent 1640ceb commit 01429fd
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion integration-tests/vertx-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<enableHttpUrlHandler>true</enableHttpUrlHandler>
<!-- Include the server certificate -->
<additionalBuildArgs>
<additionalBuildArg>-H:ResourceConfigurationFiles=${project.basedir}/src/main/resources/resources-config.json</additionalBuildArg>
<additionalBuildArg>-H:IncludeResources=.*\.jks</additionalBuildArg>
<additionalBuildArg>-H:EnableURLProtocols=http,https</additionalBuildArg>
</additionalBuildArgs>
<graalvmHome>${graalvmHome}</graalvmHome>
Expand Down

This file was deleted.

Binary file modified integration-tests/vertx-http/src/main/resources/server-keystore.jks
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
package io.quarkus.it.vertx;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.NativeImageTest;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.specification.RequestSpecification;

@NativeImageTest
public class VertxProducerResourceIT extends VertxProducerResourceTest {

}
@Test
public void testRouteRegistrationMTLS() {
RequestSpecification spec = new RequestSpecBuilder()
.setBaseUri(String.format("%s://%s", url.getProtocol(), url.getHost()))
.setPort(8443)
.setKeyStore("client-keystore.jks", "password")
.setTrustStore("client-truststore.jks", "password")
.build();
given().spec(spec).get("/my-path").then().body(containsString("OK"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.junit.jupiter.api.Test;

import io.quarkus.test.common.http.TestHTTPResource;
import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.specification.RequestSpecification;
Expand All @@ -29,6 +30,7 @@ public void testRouteRegistration() {
get("/my-path").then().body(containsString("OK"));
}

@DisabledOnNativeImage
@Test
public void testRouteRegistrationMTLS() {
RequestSpecification spec = new RequestSpecBuilder()
Expand Down
Binary file modified integration-tests/vertx-http/src/test/resources/client-keystore.jks
Binary file not shown.
Binary file not shown.

0 comments on commit 01429fd

Please sign in to comment.