Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bd3b866
(#19928) Implement Redis PUB/SUB
markovejnovic Aug 10, 2025
97525f5
Split numeric from harness.ts
Sep 23, 2025
e2831e9
fix: @nektro's PUB/SUB suggestions
Sep 26, 2025
6458341
Merge branch 'main' into user/marko/pub-sub-2.0
Jarred-Sumner Sep 26, 2025
aaec08f
wip
cirospaciari Sep 25, 2025
1d112a3
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 25, 2025
7c9958a
wip
cirospaciari Sep 25, 2025
c8a451b
reuse custom context
cirospaciari Sep 25, 2025
9a846f1
handle tls failures
cirospaciari Sep 26, 2025
0b1a421
almost
cirospaciari Sep 26, 2025
56ac5c1
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 26, 2025
9c36f10
fix tests
cirospaciari Sep 26, 2025
1d23c19
clone context
cirospaciari Sep 26, 2025
f5e4cec
fix test
cirospaciari Sep 26, 2025
c5465a4
Merge branch 'main' into ciro/fix-valkey-tls-with-pubsub
cirospaciari Sep 26, 2025
23f1e97
more
cirospaciari Sep 26, 2025
661792d
wip
cirospaciari Sep 26, 2025
1f2f15c
connecting is not connected
cirospaciari Sep 26, 2025
2e85c9f
if we are waiting for reconnection we are connecting
cirospaciari Sep 26, 2025
2f137cb
let control the js ref only in one place
cirospaciari Sep 26, 2025
c68f623
we already have a ref + lets only remove the strong before deref inst…
cirospaciari Sep 26, 2025
4002347
cleanup
cirospaciari Sep 26, 2025
2fd5791
more
cirospaciari Sep 26, 2025
55e0bf2
more
cirospaciari Sep 26, 2025
4dc3cef
more
cirospaciari Sep 26, 2025
c0fc2d5
more
cirospaciari Sep 26, 2025
198f0c9
fix duplicate toJS, also fix missing ref in JS
cirospaciari Sep 26, 2025
17e314a
dont leak memory
cirospaciari Sep 26, 2025
b02e2bf
review
cirospaciari Sep 26, 2025
faaa9e0
diff
cirospaciari Sep 26, 2025
3fd3840
Merge branch 'main' into ciro/fix-valkey-tls-with-pubsub
cirospaciari Sep 26, 2025
4678bf4
remove bad assertions
cirospaciari Sep 26, 2025
4363e7e
close next tick
cirospaciari Sep 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions src/bun.js/api/server/SSLConfig.zig
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,68 @@ pub fn deinit(this: *SSLConfig) void {
this.ca = null;
}
}
pub fn clone(this: *const SSLConfig) SSLConfig {
var cloned: SSLConfig = .{
.secure_options = this.secure_options,
.request_cert = this.request_cert,
.reject_unauthorized = this.reject_unauthorized,
.client_renegotiation_limit = this.client_renegotiation_limit,
.client_renegotiation_window = this.client_renegotiation_window,
.requires_custom_request_ctx = this.requires_custom_request_ctx,
.is_using_default_ciphers = this.is_using_default_ciphers,
.low_memory_mode = this.low_memory_mode,
.protos_len = this.protos_len,
Comment thread
cirospaciari marked this conversation as resolved.
Comment thread
cirospaciari marked this conversation as resolved.
};
const fields_cloned_by_memcopy = .{
"server_name",
"key_file_name",
"cert_file_name",
"ca_file_name",
"dh_params_file_name",
"passphrase",
"protos",
};

if (!this.is_using_default_ciphers) {
if (this.ssl_ciphers) |slice_ptr| {
const slice = std.mem.span(slice_ptr);
if (slice.len > 0) {
cloned.ssl_ciphers = bun.handleOom(bun.default_allocator.dupeZ(u8, slice));
} else {
cloned.ssl_ciphers = null;
Comment thread
cirospaciari marked this conversation as resolved.
}
}
}
Comment thread
cirospaciari marked this conversation as resolved.

inline for (fields_cloned_by_memcopy) |field| {
if (@field(this, field)) |slice_ptr| {
const slice = std.mem.span(slice_ptr);
@field(cloned, field) = bun.handleOom(bun.default_allocator.dupeZ(u8, slice));
}
}

const array_fields_cloned_by_memcopy = .{
"cert",
"key",
"ca",
};
inline for (array_fields_cloned_by_memcopy) |field| {
if (@field(this, field)) |array| {
const cloned_array = bun.handleOom(bun.default_allocator.alloc([*c]const u8, @field(this, field ++ "_count")));
@field(cloned, field) = cloned_array;
@field(cloned, field ++ "_count") = @field(this, field ++ "_count");
for (0..@field(this, field ++ "_count")) |i| {
const slice = std.mem.span(array[i]);
if (slice.len > 0) {
cloned_array[i] = bun.handleOom(bun.default_allocator.dupeZ(u8, slice));
} else {
cloned_array[i] = "";
}
}
}
}
return cloned;
}

pub const zero = SSLConfig{};

Expand Down
10 changes: 10 additions & 0 deletions src/deps/uws.zig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ pub const create_bun_socket_error_t = enum(c_int) {
invalid_ca,
invalid_ciphers,

pub fn message(this: create_bun_socket_error_t) ?[]const u8 {
return switch (this) {
.none => null,
.load_ca_file => "Failed to load CA file",
.invalid_ca_file => "Invalid CA file",
.invalid_ca => "Invalid CA",
.invalid_ciphers => "Invalid ciphers",
};
}
Comment thread
cirospaciari marked this conversation as resolved.

pub fn toJS(this: create_bun_socket_error_t, globalObject: *jsc.JSGlobalObject) jsc.JSValue {
return switch (this) {
.none => brk: {
Expand Down
Loading
Loading