-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WFLY-18475] helloworld-mutual-ssl-secured Quickstart Common Enhancem…
…ents CY2023Q3
- Loading branch information
Prarthona Paul
committed
Dec 14, 2023
1 parent
13d664e
commit 975c28d
Showing
11 changed files
with
358 additions
and
31 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
.github/workflows/quickstart_helloworld-mutual-ssl-secured_ci.yml
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: WildFly helloworld-mutual-ssl-secured Quickstart CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
paths: | ||
- 'helloworld-mutual-ssl-secured/**' | ||
- '.github/workflows/quickstart_ci.yml' | ||
|
||
jobs: | ||
call-quickstart_ci: | ||
uses: ./.github/workflows/quickstart_ci.yml | ||
with: | ||
QUICKSTART_PATH: helloworld-mutual-ssl-secured | ||
TEST_PROVISIONED_SERVER: true | ||
TEST_OPENSHIFT: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Configure a key-store in the Elytron subsystem. The path to the keystore file doesn’t actually have to exist yet. | ||
/subsystem=elytron/key-store=clientKS:add(path=client.keystore.P12, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, type=PKCS12) | ||
|
||
# Generate a new key pair for the client. We'll use an RSA key of size 2048 and we'll use CN=quickstartUser | ||
/subsystem=elytron/key-store=clientKS:generate-key-pair(alias=quickstartUser, algorithm=RSA, key-size=2048, validity=365, credential-reference={clear-text=secret}, distinguished-name="cn=quickstartUser") | ||
|
||
# Export the certificate to a file called clientCert.crt | ||
/subsystem=elytron/key-store=clientKS:export-certificate(alias=quickstartUser, path=clientCert.crt, relative-to=jboss.server.config.dir, pem=true) | ||
|
||
# Create a the server's truststore | ||
/subsystem=elytron/key-store=serverTS:add(path=server.truststore, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, type=PKCS12) | ||
|
||
# Import a certificate into the server's truststore | ||
/subsystem=elytron/key-store=serverTS:import-certificate(alias=quickstartUser, path=clientCert.crt, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, validate=false) | ||
|
||
# Persist the changes we've made to the client's keystore and the server's truststore | ||
/subsystem=elytron/key-store=serverTS:store() | ||
/subsystem=elytron/key-store=clientKS:store() | ||
|
11 changes: 11 additions & 0 deletions
11
helloworld-mutual-ssl-secured/configure-client-truststore.cli
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Export the server's certificate to a file called serverCert.crt | ||
/subsystem=elytron/key-store=applicationKS:export-certificate(alias=server, path=serverCert.crt, relative-to=jboss.server.config.dir, pem=true) | ||
|
||
# create a truststore for the client called client.truststore and add it to the server config directory | ||
/subsystem=elytron/key-store=clientTS:add(path=client.truststore, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, type=PKCS12) | ||
|
||
# import that certificate into the client truststore | ||
/subsystem=elytron/key-store=clientTS:import-certificate(alias=server, path=serverCert.crt, relative-to=jboss.server.config.dir, credential-reference={clear-text=secret}, validate=false) | ||
|
||
# Use the store function to save the truststore file | ||
/subsystem=elytron/key-store=clientTS:store() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#remove the keypairs and certificates from the keystore and truststore | ||
/subsystem=elytron/key-store=serverTS:remove-alias(alias=quickstartUser) | ||
/subsystem=elytron/key-store=clientKS:remove-alias(alias=quickstartUser) | ||
|
||
#remove the keystore and truststore | ||
/subsystem=elytron/key-store=serverTS:remove | ||
/subsystem=elytron/key-store=clientKS:remove | ||
|
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/subsystem=elytron/key-store=clientTS:remove-alias(alias=server) | ||
/subsystem=elytron/key-store=clientTS:remove |
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.