Skip to content

Commit 6a77560

Browse files
authored
fix: Prevent missing certificates (#636)
* chore: Use cert-tools to convert system truststore * fix second keytool * changelog
1 parent 8ff3577 commit 6a77560

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ All notable changes to this project will be documented in this file.
88

99
- Helm: Allow Pod `priorityClassName` to be configured ([#633]).
1010

11+
### Fixed
12+
13+
- Previously we had a bug that could lead to missing certificates ([#636]).
14+
15+
This could be the case when you specified multiple CAs in your SecretClass.
16+
We now correctly handle multiple certificates in this cases.
17+
See [this GitHub issue](https://github.com/stackabletech/issues/issues/764) for details
18+
1119
[#633]: https://github.com/stackabletech/hive-operator/pull/633
20+
[#636]: https://github.com/stackabletech/hive-operator/pull/636
1221

1322
## [25.7.0] - 2025-07-23
1423

rust/operator-binary/src/command.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::crd::{
44
DB_PASSWORD_ENV, DB_PASSWORD_PLACEHOLDER, DB_USERNAME_ENV, DB_USERNAME_PLACEHOLDER,
55
HIVE_METASTORE_LOG4J2_PROPERTIES, HIVE_SITE_XML, STACKABLE_CONFIG_DIR,
66
STACKABLE_CONFIG_MOUNT_DIR, STACKABLE_LOG_CONFIG_MOUNT_DIR, STACKABLE_TRUST_STORE,
7-
STACKABLE_TRUST_STORE_PASSWORD, SYSTEM_TRUST_STORE, SYSTEM_TRUST_STORE_PASSWORD, v1alpha1,
7+
STACKABLE_TRUST_STORE_PASSWORD, v1alpha1,
88
};
99

1010
pub fn build_container_command_args(
@@ -32,7 +32,7 @@ pub fn build_container_command_args(
3232
),
3333
// Copy system truststore to stackable truststore
3434
format!(
35-
"keytool -importkeystore -srckeystore {SYSTEM_TRUST_STORE} -srcstoretype jks -srcstorepass {SYSTEM_TRUST_STORE_PASSWORD} -destkeystore {STACKABLE_TRUST_STORE} -deststoretype pkcs12 -deststorepass {STACKABLE_TRUST_STORE_PASSWORD} -noprompt"
35+
"cert-tools generate-pkcs12-truststore --pem /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem --out {STACKABLE_TRUST_STORE} --out-password {STACKABLE_TRUST_STORE_PASSWORD}"
3636
),
3737
];
3838

@@ -44,9 +44,10 @@ pub fn build_container_command_args(
4444
}
4545

4646
if let Some(s3) = s3_connection_spec {
47-
if let Some(ca_cert) = s3.tls.tls_ca_cert_mount_path() {
48-
// The alias can not clash, as we only support a single S3Connection
49-
args.push(format!("keytool -importcert -file {ca_cert} -alias stackable-s3-ca-cert -keystore {STACKABLE_TRUST_STORE} -storepass {STACKABLE_TRUST_STORE_PASSWORD} -noprompt"));
47+
if let Some(ca_cert_file) = s3.tls.tls_ca_cert_mount_path() {
48+
args.push(format!(
49+
"cert-tools generate-pkcs12-truststore --pkcs12 {STACKABLE_TRUST_STORE}:{STACKABLE_TRUST_STORE_PASSWORD} --pem {ca_cert_file} --out {STACKABLE_TRUST_STORE} --out-password {STACKABLE_TRUST_STORE_PASSWORD}"
50+
));
5051
}
5152
}
5253

rust/operator-binary/src/crd/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ pub const METRICS_PORT_NAME: &str = "metrics";
6262
pub const METRICS_PORT: u16 = 9084;
6363

6464
// Certificates and trust stores
65-
pub const SYSTEM_TRUST_STORE: &str = "/etc/pki/java/cacerts";
66-
pub const SYSTEM_TRUST_STORE_PASSWORD: &str = "changeit";
6765
pub const STACKABLE_TRUST_STORE: &str = "/stackable/truststore.p12";
6866
pub const STACKABLE_TRUST_STORE_PASSWORD: &str = "changeit";
6967

0 commit comments

Comments
 (0)