Skip to content

Commit b7d69d2

Browse files
committed
feat(zig): bump to 0.14 for secsock compat
1 parent 732a0c7 commit b7d69d2

File tree

10 files changed

+127
-147
lines changed

10 files changed

+127
-147
lines changed

build.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ pub fn build(b: *std.Build) void {
3030
add_example(b, "fs", false, target, optimize, zzz);
3131
add_example(b, "middleware", false, target, optimize, zzz);
3232
add_example(b, "sse", false, target, optimize, zzz);
33-
add_example(b, "tls", true, target, optimize, zzz);
33+
34+
if (target.result.os.tag == .linux) {
35+
add_example(b, "tls", true, target, optimize, zzz);
36+
}
3437

3538
if (target.result.os.tag != .windows) {
3639
add_example(b, "unix", false, target, optimize, zzz);

build.zig.zon

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
.{
2-
.name = "zzz",
2+
.name = .zzz,
3+
.fingerprint = 0xc3273dca261a7ae0,
34
.version = "0.3.0",
4-
.minimum_zig_version = "0.13.0",
5+
.minimum_zig_version = "0.14.0",
56
.dependencies = .{
67
.tardy = .{
7-
.url = "git+https://github.com/tardy-org/tardy#95239a7d9547161869f365bd6cd3f0255b37c49b",
8-
.hash = "1220dfee39cf3cdb58b3d5f3001078297f02997b617990da84bdfdc506b46ece56ab",
8+
.url = "git+https://github.com/tardy-org/tardy#019a81d00efc01157b9c67c357e53fcf75e48e6e",
9+
.hash = "tardy-0.3.0-69wrgmjQAwBCaEWR3cY_3kcYM8_NJCgjTJn_C4R3_ZAj",
910
},
1011
.secsock = .{
11-
.url = "git+https://github.com/tardy-org/secsock#b532b29e046c0a05d94a76f8c135c80679e89e54",
12-
.hash = "1220264235961dbd2a0240567951be585e0087c3c69c79ebbbc37180f4ae8b15a750",
12+
.url = "git+https://github.com/tardy-org/secsock#4ed63e7fc097c0ea2a00271169c1cf434c8bd459",
13+
.hash = "secsock-0.0.0-p0qurWA-AQCLVyAV0SOjr2R5tER8TQW3pthLR-po9EUW",
1314
},
1415
},
1516

examples/tls/main.zig

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ pub fn main() !void {
6868
try socket.bind();
6969
try socket.listen(1024);
7070

71-
var s2n = try secsock.s2n.init(allocator);
72-
defer s2n.deinit();
73-
try s2n.add_cert_chain(@embedFile("certs/cert.pem"), @embedFile("certs/key.pem"));
74-
const secure = try s2n.to_secure_socket(socket, .server);
71+
var bearssl = secsock.BearSSL.init(allocator);
72+
defer bearssl.deinit();
73+
try bearssl.add_cert_chain(
74+
"CERTIFICATE",
75+
@embedFile("certs/cert.pem"),
76+
"EC PRIVATE KEY",
77+
@embedFile("certs/key.pem"),
78+
);
79+
const secure = try bearssl.to_secure_socket(socket, .server);
7580

7681
const EntryParams = struct {
7782
router: *const Router,

examples/unix/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Route = http.Route;
1515
const Router = http.Router;
1616
const Respond = http.Respond;
1717

18-
pub const std_options = .{ .log_level = .err };
18+
pub const std_options: std.Options = .{ .log_level = .err };
1919

2020
pub fn root_handler(ctx: *const Context, _: void) !Respond {
2121
return ctx.response.apply(.{

0 commit comments

Comments
 (0)