Skip to content

Commit 1fdaca7

Browse files
committed
set http.sslverify to false for tls: null
1 parent 44e2fcb commit 1fdaca7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crates/stackable-operator/src/crd/git_sync/v1alpha2_impl.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub const GIT_SYNC_LINK: &str = "current";
3535
pub const CA_CERT_VOLUME_NAME_PREFIX: &str = "ca-cert";
3636
pub const CA_CERT_MOUNT_PATH_PREFIX: &str = "/stackable/gitca";
3737
pub const GIT_SSL_CA_INFO_CONFIG_KEY: &str = "http.sslCAInfo";
38+
pub const GIT_SSL_VERIFY: &str = "http.sslverify";
3839

3940
#[derive(Snafu, Debug, EnumDiscriminants)]
4041
#[strum_discriminants(derive(IntoStaticStr))]
@@ -327,6 +328,12 @@ impl GitSyncResources {
327328
internal_git_config.insert(GIT_SSL_CA_INFO_CONFIG_KEY.to_owned(), path.to_owned());
328329
}
329330

331+
// Tls defaults to webPki but if the user has *explicitly* set this to
332+
// null then we honour this by deactivating the ssl check.
333+
if git_sync.tls.tls.is_none() {
334+
internal_git_config.insert(GIT_SSL_VERIFY.to_owned(), "false".to_owned());
335+
}
336+
330337
let mut git_sync_config = git_sync.git_sync_conf.clone();
331338

332339
// The key and value in Git configs are separated by a colon, but both can contain either

0 commit comments

Comments
 (0)