Skip to content

Commit

Permalink
Merge pull request #1692 from ExchangeUnion/2048-tls
Browse files Browse the repository at this point in the history
feat: generate 2048-bit tls certs
  • Loading branch information
sangaman authored Aug 25, 2020
2 parents 57269d8 + b6bc1ad commit 7cb2f1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grpc/GrpcServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ class GrpcServer {
* @returns the cerificate and its private key
*/
private generateCertificate = async (tlsCertPath: string, tlsKeyPath: string): Promise<{ tlsCert: string, tlsKey: string }> => {
const keys = pki.rsa.generateKeyPair(1024);
const keys = pki.rsa.generateKeyPair(2048);
const cert = pki.createCertificate();

cert.publicKey = keys.publicKey;
cert.serialNumber = String(Math.floor(Math.random() * 1024) + 1);
cert.serialNumber = `2048-${String(Math.floor(Math.random() * 100000000))}`;

// TODO: handle expired certificates
const date = new Date();
Expand Down

0 comments on commit 7cb2f1c

Please sign in to comment.