Skip to content

Commit 9a9dcbc

Browse files
committed
fix: add rejectUnauthorized:false to Redis TLS socket to handle self-signed certificate chain
1 parent e15e85c commit 9a9dcbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/utils/connections.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ export const sequelize = new Sequelize(
1010
config.db,
1111
);
1212

13-
const redisTlsUrl = config.redis.tlsUrl; // REDIS_URL 환경변수 우선 사용 (TLS 포함)
14-
const isTlsSupported = redisTlsUrl?.startsWith?.('rediss://');
13+
const redisTlsUrl = config.redis.tlsUrl; // REDIS_TLS_URL 또는 REDIS_URL
14+
const isTlsSupported = !!redisTlsUrl && redisTlsUrl.startsWith('rediss://');
1515

1616
export const redisClient = redisTlsUrl
1717
? createClient({
1818
url: redisTlsUrl,
1919
socket: {
2020
tls: isTlsSupported,
21+
rejectUnauthorized: false, // `Redis Client Error: self-signed certificate in certificate chain` 오류 우회; 헤로쿠 공식문서도 이 옵션 사용으로 명시되어 있음
2122
reconnectStrategy: (retries: number) => {
2223
if (retries > 10) {
2324
return new Error('Retry count exhausted');

0 commit comments

Comments
 (0)