#TODO
Ensure the JAVA_HOME variable is defined:
echo $JAVA_HOMEIf it is empty, set the variable:
# For example, for Java 17 on Ubuntu
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"Next, define the path to the CA certificate:
ca_cert_path="./services/minica/app/certs/ca_cert.pem"To import into Java's default CA keystore, use the -cacerts option:
sudo keytool -import -trustcacerts -file $ca_cert_path -alias local-env-ca-cert -cacertsTo specify a custom path for the CA certificates, use:
ca_certs_dir_path="$JAVA_HOME/lib/security/cacerts"
sudo keytool -import -trustcacerts -file $ca_cert_path -alias local-env-ca-cert -keystore $ca_certs_dir_pathCopy keystore to the project's resources ssl directory
ks_path="./services/minica/app/certs/stores/local-env.com.ks"
ssl_ks_path="<JAVA_PROJECT_DIR>/src/main/resources/ssl/activemq-local-env.ks"
cp $ks_path $ssl_ks_pathCopy truststore to the project's resources ssl directory
ts_path="./services/minica/app/certs/stores/ca-cert.ts"
ssl_ts_path="<JAVA_PROJECT_DIR>/src/main/resources/ssl/activemq-local-env.ts"
cp $ts_path $ssl_ts_pathCopy truststore to the project's resources ssl directory
ts_path="./services/minica/app/certs/stores/ca-cert.ts"
ssl_ts_path="<JAVA_PROJECT_DIR>/src/main/resources/ssl/kafka-local-env.ts"
cp $ts_path $ssl_ts_path