Skip to content

Commit 0c9c6a2

Browse files
author
Chomp
committed
Updated createHttpServer to target tls1.2
1 parent 3edb8ca commit 0c9c6a2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

project/src/servers/HttpServer.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,16 @@ export class HttpServer {
8585
} catch (err: unknown) {
8686
const timer = new Timer();
8787
credentials = await this.generateSelfSignedCertificate();
88-
this.logger.debug(`Generating self-signed SSL certificate took ${timer.getTime("sec")}s`);
88+
this.logger.debug(`Generating self-signed SSL certificate took: ${timer.getTime("sec")}s`);
8989
}
90-
return https.createServer(credentials);
90+
91+
const options: https.ServerOptions = {
92+
cert: credentials.cert,
93+
key: credentials.key,
94+
minVersion: "TLSv1.2",
95+
maxVersion: "TLSv1.2",
96+
};
97+
return https.createServer(options);
9198
}
9299

93100
/**

0 commit comments

Comments
 (0)