Skip to content

Commit c35fe71

Browse files
update encoding in userModel.ts
1 parent 3a149c5 commit c35fe71

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/models/userModel.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ dotenv.config();
77

88
const { USER_DB_USER, USER_DB_PW } = process.env;
99
const SSL_KEY =
10-
(process.env.SSL_KEY as string) || fs.readFileSync('./.cert/key.pem').toString();
10+
Buffer.from(process.env.SSL_KEY as string, 'base64').toString('ascii') ||
11+
fs.readFileSync('./.cert/key.pem').toString();
1112
const SSL_CERT =
12-
(process.env.SSL_CERT as string) || fs.readFileSync('./.cert/cert.pem').toString();
13+
Buffer.from(process.env.SSL_CERT as string, 'base64').toString('ascii') ||
14+
fs.readFileSync('./.cert/cert.pem').toString();
1315

1416
const pool = mysql
1517
.createPool({

0 commit comments

Comments
 (0)