Skip to content

Lightpanda: the headless browser designed for AI and automation

`Network`: check if cert store is empty

Halil Durak90387b401d30
diff --git a/src/network/Network.zig b/src/network/Network.zig
index 2e34a8cb8..f637c872d 100644
--- a/src/network/Network.zig
+++ b/src/network/Network.zig
@@ -749,6 +749,8 @@ fn createX509Store(allocator: Allocator) CreateX509StoreError!*crypto.X509_STORE
break :blk;
}
}
+
+ log.warn(.app, "No system certificates", .{});
},
else => {
// Prefer stdlib's cert scanner.
@@ -757,6 +759,10 @@ fn createX509Store(allocator: Allocator) CreateX509StoreError!*crypto.X509_STORE
defer bundle.deinit(allocator);
const bytes = bundle.bytes.items;
+ if (bytes.len == 0) {
+ log.warn(.app, "No system certificates", .{});
+ return store;
+ }
var it = bundle.map.valueIterator();
while (it.next()) |index| {
// d2i_X509 reads the cert's own DER length header to find its end and