File tree Expand file tree Collapse file tree 6 files changed +45
-73
lines changed Expand file tree Collapse file tree 6 files changed +45
-73
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ init_keycloak() {
1717 print " > KEYCLOAK_CONFIG_DIR: ${KEYCLOAK_CONFIG_DIR} "
1818 print " > KEYCLOAK_URL: ${KEYCLOAK_URL} "
1919 print " > KEYCLOAK_DOCKER_IMAGE: ${KEYCLOAK_DOCKER_IMAGE} "
20+
21+ generate-ca-server-client-kpi keycloak $KEYCLOAK_CONFIG_DIR
22+
2023}
2124start_keycloak () {
2225 begin " Starting keycloak ..."
@@ -44,7 +47,7 @@ start_keycloak() {
4447 --https-certificate-file=/opt/keycloak/data/import/server_keycloak_certificate.pem \
4548 --https-certificate-key-file=/opt/keycloak/data/import/server_keycloak_key.pem
4649
47- wait_for_oidc_endpoint keycloak $KEYCLOAK_URL $MOUNT_KEYCLOAK_CONF_DIR /ca_certificate .pem
50+ wait_for_oidc_endpoint keycloak $KEYCLOAK_URL $MOUNT_KEYCLOAK_CONF_DIR /ca_keycloak_certificate .pem
4851 end " Keycloak is ready"
4952
5053 print " Note: If you modify keycloak configuration. Make sure to run the following command to export the configuration."
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ SCRIPT=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
4+
5+ source $SCRIPT /../common
6+
7+
38init_rabbitmq () {
49 RABBITMQ_CONFIG_DIR=${TEST_CONFIG_DIR}
510 RABBITMQ_DOCKER_IMAGE=${RABBITMQ_DOCKER_IMAGE:- rabbitmq}
Original file line number Diff line number Diff line change @@ -375,6 +375,42 @@ generate_env_file() {
375375 source $ENV_FILE
376376 end " Finished generating env file."
377377}
378+ generate-ca-server-client-kpi () {
379+ NAME=$1
380+ FOLDER=$2
381+ if [[ ! -f " ${FOLDER} /server_${NAME} _key.pem" ]]; then
382+ do_generate-ca-server-client-kpi $1 $2
383+ fi
384+ }
385+ do_generate-ca-server-client-kpi () {
386+ NAME=$1
387+ FOLDER=$2
388+ ROOT=$SELENIUM_ROOT_FOLDER
389+
390+ begin " Generate certs for $NAME "
391+
392+ if [ ! -d " $ROOT /tls-gen" ]; then
393+ git clone https://github.com/michaelklishin/tls-gen $ROOT /tls-gen
394+ fi
395+
396+ print " Generating CA and Server (localhost and $NAME ) PKI under $FOLDER ..."
397+ mkdir -p $FOLDER
398+
399+ CUR_DIR=$( pwd)
400+ cd $ROOT /tls-gen/basic
401+ make CN=$NAME
402+ # make PASSWORD=foobar
403+ make verify
404+ make info
405+ cd $CUR_DIR
406+
407+ cp $ROOT /tls-gen/basic/result/ca_certificate.pem $FOLDER /ca_${NAME} _certificate.pem
408+ cp $ROOT /tls-gen/basic/result/server_${NAME} _certificate.pem $FOLDER
409+ cp $ROOT /tls-gen/basic/result/server_${NAME} _key.pem $FOLDER
410+ cp $ROOT /tls-gen/basic/result/server_${NAME} .p12 $FOLDER
411+ end " SSL Certificates generated for $NAME under $FOLDER "
412+ }
413+
378414run () {
379415 runWith rabbitmq
380416}
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments