Skip to content

Commit 2f8e8ac

Browse files
authored
fix(sandbox): inject GIT_SSL_CAINFO so git clone trusts the sandbox CA (#918)
Ubuntu Noble's git links against libcurl-gnutls, which does not read SSL_CERT_FILE. Without GIT_SSL_CAINFO, `git clone` over HTTPS fails inside every community sandbox image with "server certificate verification failed". Add GIT_SSL_CAINFO to tls_env_vars pointing at the same combined CA bundle already used by CURL_CA_BUNDLE / REQUESTS_CA_BUNDLE. Fixes #790 Fixes NVIDIA/NemoClaw#2270 Fixes NVIDIA/NemoClaw#1828 Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
1 parent f954e59 commit 2f8e8ac

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

crates/openshell-sandbox/src/child_env.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,17 @@ pub(crate) fn proxy_env_vars(proxy_url: &str) -> [(&'static str, String); 9] {
2424
pub(crate) fn tls_env_vars(
2525
ca_cert_path: &Path,
2626
combined_bundle_path: &Path,
27-
) -> [(&'static str, String); 4] {
27+
) -> [(&'static str, String); 5] {
2828
let ca_cert_path = ca_cert_path.display().to_string();
2929
let combined_bundle_path = combined_bundle_path.display().to_string();
3030
[
3131
("NODE_EXTRA_CA_CERTS", ca_cert_path.clone()),
3232
("SSL_CERT_FILE", combined_bundle_path.clone()),
3333
("REQUESTS_CA_BUNDLE", combined_bundle_path.clone()),
34-
("CURL_CA_BUNDLE", combined_bundle_path),
34+
("CURL_CA_BUNDLE", combined_bundle_path.clone()),
35+
// Ubuntu Noble's git links against libcurl-gnutls, which ignores SSL_CERT_FILE.
36+
// git reads GIT_SSL_CAINFO (or http.sslCAInfo) to locate the CA bundle.
37+
("GIT_SSL_CAINFO", combined_bundle_path),
3538
]
3639
}
3740

@@ -79,5 +82,8 @@ mod tests {
7982

8083
assert!(stdout.contains("NODE_EXTRA_CA_CERTS=/etc/openshell-tls/openshell-ca.pem"));
8184
assert!(stdout.contains("SSL_CERT_FILE=/etc/openshell-tls/ca-bundle.pem"));
85+
assert!(stdout.contains("REQUESTS_CA_BUNDLE=/etc/openshell-tls/ca-bundle.pem"));
86+
assert!(stdout.contains("CURL_CA_BUNDLE=/etc/openshell-tls/ca-bundle.pem"));
87+
assert!(stdout.contains("GIT_SSL_CAINFO=/etc/openshell-tls/ca-bundle.pem"));
8288
}
8389
}

0 commit comments

Comments
 (0)