-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: generate 2048-bit tls certs #1692
Conversation
As discussed on the call, @sangaman can take over this PR to see if there is an easy way to make changes like this backwards compatible |
lib/grpc/GrpcServer.ts
Outdated
const cert = pki.createCertificate(); | ||
|
||
cert.publicKey = keys.publicKey; | ||
cert.serialNumber = String(Math.floor(Math.random() * 1024) + 1); | ||
cert.serialNumber = String(Math.floor(Math.random() * 2048) + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this actually needs to change to use 2048 bit keys. Maybe we can make the serial number indicate that the cert is 2048 bit? Then we'd have an easy to check if existing certs are 2048 or 1024.
So something like this
cert.serialNumber = `2048-${String(Math.floor(Math.random() * 100000000))}`;
That would give us serial numbers that look like "2048-" followed by a random number up to 8 digits. And I could check if a cert is 2048 bit just by seeing if the serial number starts with "2048".
Would you still want to merge this one? @sangaman |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me with the latest commit, just needs to squash the commit. Also this shouldn't be a chore
commit but rather a feat
since it's changing something functional with the code.
Could you squash and change the commit to the |
This PR generates 2048-bit TLS certificate instead of 1024-bit. Related to ExchangeUnion/xud-docker#533 (comment)