-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathssl.zig
31 lines (28 loc) · 902 Bytes
/
ssl.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const std = @import("std");
pub fn init() anyerror!void {
std.debug.print("[DEBUG] nossl init\n", .{});
}
pub const SslConn = struct {
// state that an SslConn uses that is "pinned" to a fixed address
// this has to be separate from SslConn until https://github.com/ziglang/zig/issues/7769 is implemented
pub const Pinned = struct {};
pub fn init(file: std.net.Stream, serverName: []const u8, pinned: *Pinned) !SslConn {
_ = file;
_ = serverName;
_ = pinned;
return error.NoSslConfigured;
}
pub fn deinit(self: SslConn) void {
_ = self;
}
pub fn read(self: SslConn, data: []u8) !usize {
_ = self;
_ = data;
@panic("nossl has been configured");
}
pub fn write(self: SslConn, data: []const u8) !usize {
_ = self;
_ = data;
@panic("nossl has been configured");
}
};