Skip to content

Commit 7e635e6

Browse files
committed
handle tls alert switch correctly and link correct error set compare issue
1 parent d6abd2a commit 7e635e6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/std/crypto/tls.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pub const AlertDescription = enum(u8) {
225225
.unknown_psk_identity => error.TlsAlertUnknownPskIdentity,
226226
.certificate_required => error.TlsAlertCertificateRequired,
227227
.no_application_protocol => error.TlsAlertNoApplicationProtocol,
228-
else => error.TlsAlertUnknown,
228+
_ => error.TlsAlertUnknown,
229229
};
230230
}
231231
};

lib/std/http/Client.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub const Connection = struct {
169169
.plain => conn.stream.readAtLeast(buffer, len),
170170
.tls => conn.tls_client.readAtLeast(conn.stream, buffer, len),
171171
} catch |err| {
172-
// is there a better way to check if an error is a member of a certain set
172+
// TODO: https://github.com/ziglang/zig/issues/2473
173173
if (mem.startsWith(u8, @errorName(err), "TlsAlert")) return error.TlsAlert;
174174

175175
switch (err) {

0 commit comments

Comments
 (0)