mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-01 13:13:53 +08:00
prefer pkcs1 for acme certs
This commit is contained in:
parent
bf60817694
commit
97b53a4fd3
2 changed files with 4 additions and 5 deletions
|
@ -91,7 +91,7 @@ const getAcmeAccount = async (acmeOptions, certHandler) => {
|
|||
|
||||
// account not found, create a new one
|
||||
log.info('ACME', 'ACME account for %s not found, provisioning new one from %s', acmeOptions.key, acmeOptions.directoryUrl);
|
||||
const accountKey = await certHandler.generateKey(acmeOptions.keyBits, acmeOptions.keyExponent, { privateKeyEncoding: 'pkcs1' });
|
||||
const accountKey = await certHandler.generateKey(acmeOptions.keyBits, acmeOptions.keyExponent);
|
||||
|
||||
const jwkAccount = pem2jwk(accountKey);
|
||||
log.info('ACME', 'Generated Acme account key for %s', acmeOptions.key);
|
||||
|
@ -243,7 +243,6 @@ const acquireCert = async (domain, acmeOptions, certificateData, certHandler) =>
|
|||
};
|
||||
|
||||
const aID = ((acmeAccount && acmeAccount.account && acmeAccount.account.key && acmeAccount.account.key.kid) || '').split('/acct/').pop();
|
||||
|
||||
log.info('ACME', 'Generate ACME cert for %s (account=%s)', domain, aID);
|
||||
const cert = await acme.certificates.create(certificateOptions);
|
||||
if (!cert || !cert.cert) {
|
||||
|
@ -281,7 +280,7 @@ const acquireCert = async (domain, acmeOptions, certificateData, certHandler) =>
|
|||
log.error('ACME', 'Redis call failed key=%s domains=%s error=%s', domainSafeLockKey, domain, err.message);
|
||||
}
|
||||
|
||||
log.error('ACME', 'Failed to generate cert domains=%s error=%s', domain, err.stack);
|
||||
log.error('ACME', 'Failed to generate certificate domains=%s error=%s', domain, err.stack);
|
||||
|
||||
if (certificateData && certificateData._id) {
|
||||
try {
|
||||
|
|
|
@ -55,11 +55,11 @@ class CertHandler {
|
|||
modulusLength: keyBits || 2048, // options
|
||||
publicExponent: keyExponent || 65537,
|
||||
publicKeyEncoding: {
|
||||
type: 'spki',
|
||||
type: opts.publicKeyEncoding || 'spki',
|
||||
format: 'pem'
|
||||
},
|
||||
privateKeyEncoding: {
|
||||
type: opts.privateKeyEncoding || 'pkcs8',
|
||||
type: opts.privateKeyEncoding || 'pkcs1',
|
||||
format: 'pem'
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue