Skip to content

Commit

Permalink
Migrate to newer Quarkus TLS configuration parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Sep 19, 2024
1 parent 9d85993 commit 3aa255c
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 22 deletions.
18 changes: 11 additions & 7 deletions docs/modules/ROOT/examples/mtls/application.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# The store type can be pkcs12 or jks
# The store type can be p12 or jks
keystore.type = ${keystore.type}

# tag::mtls[]
# Server keystore for Simple TLS
quarkus.http.ssl.certificate.key-store-file = localhost-keystore.${keystore.type}
quarkus.http.ssl.certificate.key-store-password = localhost-keystore-password
quarkus.http.ssl.certificate.key-store-key-alias = localhost
quarkus.http.ssl.certificate.key-store-key-password = localhost-keystore-password
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type}.path = localhost-keystore.${keystore.type}
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type}.password = localhost-keystore-password
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type}.alias = localhost
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type}.alias-password = localhost-keystore-password
# Server truststore for Mutual TLS
quarkus.http.ssl.certificate.trust-store-file = localhost-truststore.${keystore.type}
quarkus.http.ssl.certificate.trust-store-password = localhost-truststore-password
quarkus.tls.localhost-${keystore.type}.trust-store.${keystore.type}.path = localhost-truststore.${keystore.type}
quarkus.tls.localhost-${keystore.type}.trust-store.${keystore.type}.password = localhost-truststore-password
#
quarkus.http.tls-configuration-name=localhost-${keystore.type}

# Do not allow any clients which do not prove their indentity through an SSL certificate
quarkus.http.ssl.client-auth = required


# CXF service
quarkus.cxf.endpoint."/mTls".implementor = io.quarkiverse.cxf.it.auth.mtls.MTlsHelloServiceImpl

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
# Server side SSL
# tag::server-key-store[]
# <1>
quarkus.http.ssl.certificate.key-store-file = localhost-keystore.${keystore.type}
quarkus.http.ssl.certificate.key-store-password = localhost-keystore-password
quarkus.http.ssl.certificate.key-store-key-alias = localhost
quarkus.http.ssl.certificate.key-store-key-password = localhost-keystore-password
quarkus.tls.key-store.${keystore.type.short}.path = localhost-keystore.${keystore.type}
quarkus.tls.key-store.${keystore.type.short}.password = localhost-keystore-password
quarkus.tls.key-store.${keystore.type.short}.alias = localhost
quarkus.tls.key-store.${keystore.type.short}.alias-password = localhost-keystore-password
# end::server-key-store[]

# tag::quarkus-cxf-rt-ws-security.adoc-service[]
# A service with encrypt-sign-policy.xml set
quarkus.cxf.endpoint."/helloEncryptSign".implementor = io.quarkiverse.cxf.it.security.policy.EncryptSignPolicyHelloServiceImpl
# can be jks or pkcs12 - set from Maven profiles in this test
keystore.type = ${keystore.type}
keystore.type.short = ${keystore.type.short}
# Signature settings
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.username = bob
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.password = bob-keystore-password
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/mtls/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
</property>
</activation>
<properties>
<keystore.type.short>p12</keystore.type.short>
<keystore.type>pkcs12</keystore.type>
</properties>
<build>
Expand Down Expand Up @@ -131,6 +132,7 @@
</property>
</activation>
<properties>
<keystore.type.short>jks</keystore.type.short>
<keystore.type>jks</keystore.type>
</properties>
<build>
Expand Down
19 changes: 12 additions & 7 deletions integration-tests/mtls/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# The store type can be pkcs12 or jks
# The store type can be p12 or jks
keystore.type = ${keystore.type}
keystore.type.short = ${keystore.type.short}

# tag::mtls[]
# Server keystore for Simple TLS
quarkus.http.ssl.certificate.key-store-file = localhost-keystore.${keystore.type}
quarkus.http.ssl.certificate.key-store-password = localhost-keystore-password
quarkus.http.ssl.certificate.key-store-key-alias = localhost
quarkus.http.ssl.certificate.key-store-key-password = localhost-keystore-password
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type.short}.path = localhost-keystore.${keystore.type}
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type.short}.password = localhost-keystore-password
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type.short}.alias = localhost
quarkus.tls.localhost-${keystore.type}.key-store.${keystore.type.short}.alias-password = localhost-keystore-password
# Server truststore for Mutual TLS
quarkus.http.ssl.certificate.trust-store-file = localhost-truststore.${keystore.type}
quarkus.http.ssl.certificate.trust-store-password = localhost-truststore-password
quarkus.tls.localhost-${keystore.type}.trust-store.${keystore.type.short}.path = localhost-truststore.${keystore.type}
quarkus.tls.localhost-${keystore.type}.trust-store.${keystore.type.short}.password = localhost-truststore-password
#
quarkus.http.tls-configuration-name=localhost-${keystore.type}

# Do not allow any clients which do not prove their indentity through an SSL certificate
quarkus.http.ssl.client-auth = required


# CXF service
quarkus.cxf.endpoint."/mTls".implementor = io.quarkiverse.cxf.it.auth.mtls.MTlsHelloServiceImpl

Expand Down
2 changes: 2 additions & 0 deletions integration-tests/ws-security-policy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
</property>
</activation>
<properties>
<keystore.type.short>p12</keystore.type.short>
<keystore.type>pkcs12</keystore.type>
</properties>
<dependencies>
Expand Down Expand Up @@ -156,6 +157,7 @@
</property>
</activation>
<properties>
<keystore.type.short>jks</keystore.type.short>
<keystore.type>jks</keystore.type>
</properties>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
# Server side SSL
# tag::server-key-store[]
# <1>
quarkus.http.ssl.certificate.key-store-file = localhost-keystore.${keystore.type}
quarkus.http.ssl.certificate.key-store-password = localhost-keystore-password
quarkus.http.ssl.certificate.key-store-key-alias = localhost
quarkus.http.ssl.certificate.key-store-key-password = localhost-keystore-password
quarkus.tls.key-store.${keystore.type.short}.path = localhost-keystore.${keystore.type}
quarkus.tls.key-store.${keystore.type.short}.password = localhost-keystore-password
quarkus.tls.key-store.${keystore.type.short}.alias = localhost
quarkus.tls.key-store.${keystore.type.short}.alias-password = localhost-keystore-password
# end::server-key-store[]

# tag::quarkus-cxf-rt-ws-security.adoc-service[]
# A service with encrypt-sign-policy.xml set
quarkus.cxf.endpoint."/helloEncryptSign".implementor = io.quarkiverse.cxf.it.security.policy.EncryptSignPolicyHelloServiceImpl
# can be jks or pkcs12 - set from Maven profiles in this test
keystore.type = ${keystore.type}
keystore.type.short = ${keystore.type.short}
# Signature settings
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.username = bob
quarkus.cxf.endpoint."/helloEncryptSign".security.signature.password = bob-keystore-password
Expand Down

0 comments on commit 3aa255c

Please sign in to comment.