Skip to content

Commit

Permalink
feat: generate 2048-bit tls certs
Browse files Browse the repository at this point in the history
  • Loading branch information
reliveyy authored and sangaman committed Aug 25, 2020
1 parent aa41615 commit b6bc1ad
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 b6bc1ad

Please sign in to comment.