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

Fix certificate generation #460

Open
wants to merge 1 commit into
base: 7.7.1-post
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions scripts/helper/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ clean_demo_env()

}

check_num_certs() {
check_truststore_valid() {
local DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
NUM_CERTS=$(docker run --rm -v $DIR/../security:/etc/kafka/secrets localbuild/connect:${CONFLUENT_DOCKER_TAG}-${CONNECTOR_VERSION} \
keytool --list --keystore /etc/kafka/secrets/kafka.connect.truststore.jks --storepass confluent | grep trusted | wc -l)
keytool --list --keystore /etc/kafka/secrets/kafka.connect.truststore.jks --storepass confluent | grep trusted | wc -l | xargs)
if [[ "$NUM_CERTS" -eq "1" ]]; then
return 1
return 0
fi
return 0
return 1
}

create_certificates()
Expand Down
6 changes: 3 additions & 3 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CLEAN=${CLEAN:-false}
build_connect_image

# Set the CLEAN variable to true if cert doesn't exist
if ! [[ -f "${DIR}/security/controlCenterAndKsqlDBServer-ca1-signed.crt" ]] || ! check_num_certs; then
if ! [[ -f "${DIR}/security/controlCenterAndKsqlDBServer-ca1-signed.crt" ]] || ! check_truststore_valid; then
echo "INFO: Running with CLEAN=true because instructed or certificates don't yet exist."
clean_demo_env
CLEAN=true
Expand All @@ -36,8 +36,8 @@ echo

if [[ "$CLEAN" == "true" ]] ; then
create_certificates || exit 1
if [[ ! check_num_certs ]]; then
echo -e "\nERROR: Expected ~147 trusted certificates on the Kafka Connect server but got 1. Please troubleshoot and try again."
if ! check_truststore_valid; then
echo -e "\nERROR: Expected valid trusted certificates on the Kafka Connect server. Please troubleshoot and try again."
exit 1
fi
fi
Expand Down