Skip to content

Commit

Permalink
chore: refactor certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Dec 24, 2024
1 parent b87043c commit a637a58
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/certificates.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ export async function createCertificate ( { domains, maxAge, commonName, ...attr

return {
"certificate": `-----BEGIN CERTIFICATE-----
${ certificate.toString( "base64" ) }
${ certificate
.toString( "base64" )
.split( /(.{64})/ )
.filter( line => line )
.join( "\n" ) }
-----END CERTIFICATE-----
`,
"privateKey": crypto.KeyObject.from( keyPair.privateKey ).export( {
Expand Down

0 comments on commit a637a58

Please sign in to comment.