Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration for truststore do not work #29

Open
albfan opened this issue May 27, 2024 · 0 comments
Open

Configuration for truststore do not work #29

albfan opened this issue May 27, 2024 · 0 comments

Comments

@albfan
Copy link

albfan commented May 27, 2024

Describe the bug

custom truststore is not properly configured

Expected behavior

Have access to new added certificates

Actual behavior

new truststore is not correctly configured

How to Reproduce?

set trustStoreSecret with a secret holding the customized truststore

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito Operator version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

There's a workaround overriding launch/configure-custom-truststore.sh

to

#!/bin/sh
set -e
# imports
source "${KOGITO_HOME}"/launch/logging.sh
function prepareEnv() {
    # keep it on alphabetical order
    unset CUSTOM_TRUSTSTORE
    unset CUSTOM_TRUSTSTORE_PASSWORD
}
function configure() {
    configure_custom_truststore
}
# Exit codes
# 1 - General error
function configure_custom_truststore() {
    local defaultCustomTruststorePath="${KOGITO_HOME}/certs/custom-truststore"
    if [ ! -z "${CUSTOM_TRUSTSTORE}" ]; then
        CUSTOM_TRUSTSTORE_PATH="${defaultCustomTruststorePath}/${CUSTOM_TRUSTSTORE}/cacerts"
        log_info "---> Configuring custom Java Truststore '${CUSTOM_TRUSTSTORE}' in the path ${defaultCustomTruststorePath}"
        if [ ! -f "${CUSTOM_TRUSTSTORE_PATH}" ]; then
            log_error "---> A custom truststore was specified ('${CUSTOM_TRUSTSTORE}'), but wasn't found in the path ${defaultCustomTruststorePath}. \
Make sure that the path is mounted and accessible in your container"
            exit 1
        fi
        CUSTOM_TRUSTSTORE_ARGS="-Djavax.net.ssl.trustStore=${CUSTOM_TRUSTSTORE_PATH}"
        if [ ! -z "${CUSTOM_TRUSTSTORE_PASSWORD}" ]; then
            CUSTOM_TRUSTSTORE_ARGS="${CUSTOM_TRUSTSTORE_ARGS} -Djavax.net.ssl.trustStorePassword=${CUSTOM_TRUSTSTORE_PASSWORD}"
        fi
    fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant