Skip to content

Commit

Permalink
std.http.Client: change ssl key log creation permission bits
Browse files Browse the repository at this point in the history
This is the same mode used by openssh for private keys.  This does not
change the mode of an existing file, so users who need something
different can pre-create the file with their designed permissions or
change them after the fact, and running another process that writes to
the key log will not change it back.
  • Loading branch information
jacobly0 committed Nov 8, 2024
1 parent 75adba7 commit d92c8a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/std/http/Client.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ pub fn connectTcp(client: *Client, host: []const u8, port: u16, protocol: Connec
error.OutOfMemory => return error.OutOfMemory,
};
defer client.allocator.free(ssl_key_log_path);
break :ssl_key_log_file std.fs.cwd().createFile(ssl_key_log_path, .{ .truncate = false }) catch null;
break :ssl_key_log_file std.fs.cwd().createFile(ssl_key_log_path, .{ .truncate = false, .mode = 0o600 }) catch null;
} else null;
errdefer if (ssl_key_log_file) |key_log_file| key_log_file.close();

Expand Down

0 comments on commit d92c8a6

Please sign in to comment.