-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4663 from CSTDev/add-client-auth-config
Add mutual SSL properties
- Loading branch information
Showing
16 changed files
with
194 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
integration-tests/vertx-http/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
vertx.event-loops.size=2 | ||
vertx.event-loops.size=2 | ||
quarkus.http.ssl.certificate.key-store-file=server-keystore.jks | ||
quarkus.http.ssl.certificate.key-store-password=password | ||
quarkus.http.ssl.certificate.trust-store-file=server-truststore.jks | ||
quarkus.http.ssl.certificate.trust-store-password=password | ||
quarkus.http.ssl.client-auth=REQUIRED |
Binary file not shown.
Binary file added
BIN
+925 Bytes
integration-tests/vertx-http/src/main/resources/server-truststore.jks
Binary file not shown.
38 changes: 37 additions & 1 deletion
38
integration-tests/vertx-http/src/test/java/io/quarkus/it/vertx/VertxProducerResourceIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,44 @@ | ||
package io.quarkus.it.vertx; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import java.security.Provider; | ||
import java.security.Security; | ||
|
||
import org.junit.jupiter.api.AfterAll; | ||
import org.junit.jupiter.api.BeforeAll; | ||
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 { | ||
|
||
} | ||
private static Provider sunECProvider; | ||
|
||
@BeforeAll | ||
public static void setupSecProvider() { | ||
//Remove SunEC provider for the test as it's not being provided for tests. | ||
sunECProvider = Security.getProvider("SunEC"); | ||
Security.removeProvider("SunEC"); | ||
} | ||
|
||
@AfterAll | ||
public static void restoreSecProvider() { | ||
Security.addProvider(sunECProvider); | ||
} | ||
|
||
@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")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+925 Bytes
integration-tests/vertx-http/src/test/resources/client-truststore.jks
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.