solaris: load CA certs file

This commit is contained in:
Ryan Zezeski 2023-09-26 16:05:24 -06:00
parent c17ebdca6a
commit 68bcd7ddd4

View File

@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {
.netbsd => return rescanBSD(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),
.dragonfly => return rescanBSD(cb, gpa, "/usr/local/etc/ssl/cert.pem"),
.windows => return rescanWindows(cb, gpa),
.solaris => return rescanSolaris(cb, gpa, "/etc/ssl/cacert.pem"),
else => {},
}
}
@ -151,6 +152,15 @@ fn rescanWindows(cb: *Bundle, gpa: Allocator) RescanWindowsError!void {
cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
}
const RescanSolarisError = AddCertsFromFilePathError;
fn rescanSolaris(cb: *Bundle, gpa: Allocator, cert_file_path: []const u8) RescanSolarisError!void {
cb.bytes.clearRetainingCapacity();
cb.map.clearRetainingCapacity();
try addCertsFromFilePathAbsolute(cb, gpa, cert_file_path);
cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len);
}
pub const AddCertsFromDirPathError = fs.File.OpenError || AddCertsFromDirError;
pub fn addCertsFromDirPath(