Skip to content

Commit

Permalink
feat: always use TLS if is specified (#471)
Browse files Browse the repository at this point in the history
Follows-up to #470
  • Loading branch information
uki00a authored Dec 7, 2024
1 parent cfafd88 commit e33db58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export interface Connection {

export interface RedisConnectionOptions {
tls?: boolean;
/**
* A list of root certificates, implies {@linkcode RedisConnectionOptions.tls}
*/
caCerts?: string[];
db?: number;
password?: string;
Expand Down Expand Up @@ -213,7 +216,7 @@ export class RedisConnection implements Connection {
hostname: this.hostname,
port: parsePortLike(this.port),
};
const conn: Deno.Conn = this.options?.tls
const conn: Deno.Conn = this.options?.tls || this.options?.caCerts != null
? await Deno.connectTls({ ...dialOpts, caCerts: this.options?.caCerts })
: await Deno.connect(dialOpts);

Expand Down

0 comments on commit e33db58

Please sign in to comment.