mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 02:33:06 +00:00
chore: added TLS error handling to database and cache
This commit is contained in:
parent
7fd9497fb8
commit
4def8df3fe
4 changed files with 47 additions and 16 deletions
|
@ -93,11 +93,21 @@ async function initializeRedisConnection() {
|
|||
},
|
||||
maxRetriesPerRequest: 3,
|
||||
enableOfflineQueue: true,
|
||||
tls: {
|
||||
ca: fs.readFileSync(path.resolve('./certs/cache-ca.crt')),
|
||||
cert: fs.readFileSync(path.resolve('./certs/cache-server.crt')),
|
||||
key: fs.readFileSync(path.resolve('./certs/cache-client.key')),
|
||||
},
|
||||
tls: (() => {
|
||||
try {
|
||||
return {
|
||||
ca: fs.readFileSync(path.resolve('./certs/cache-ca.crt')),
|
||||
key: fs.readFileSync(path.resolve('./certs/cache-client.key')),
|
||||
cert: fs.readFileSync(path.resolve('./certs/cache-server.crt')),
|
||||
};
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
'Failed to load certificates for cache, using insecure connection:',
|
||||
error,
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
})(),
|
||||
});
|
||||
|
||||
// ========================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue