Skip to content

Commit 51daf4b

Browse files
committed
Add newlines when concatenating certs
Signed-off-by: James Duong <[email protected]>
1 parent e420cf4 commit 51daf4b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

glide-core/src/client/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,14 +1170,21 @@ async fn create_cluster_client(
11701170
)));
11711171
}
11721172
let mut combined_certs = Vec::new();
1173-
for cert in &request.root_certs {
1173+
for (i, cert) in request.root_certs.iter().enumerate() {
11741174
if cert.is_empty() {
11751175
return Err(RedisError::from((
11761176
ErrorKind::InvalidClientConfig,
11771177
"Root certificate cannot be empty byte string",
11781178
)));
11791179
}
1180+
1181+
// Add the certificate
11801182
combined_certs.extend_from_slice(cert);
1183+
1184+
// Ensure proper PEM separation between certificates
1185+
if i < request.root_certs.len() - 1 && !cert.ends_with(b"\n") {
1186+
combined_certs.push(b'\n');
1187+
}
11811188
}
11821189

11831190
// DEBUG: Print certificate content for cluster connections

0 commit comments

Comments
 (0)