Merge pull request #51 from certd/acme_sync

[acme] sync upgrade [trident-sync]
pull/68/head
Greper 2024-05-22 03:24:13 +08:00 committed by GitHub
commit dd730f6beb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 7 deletions

View File

@ -28,6 +28,6 @@ chown root:root /usr/local/bin/pebble
chmod 0755 /usr/local/bin/pebble chmod 0755 /usr/local/bin/pebble
# Config # Config
sed -i 's/test\/certs\/localhost/\/etc\/pebble/' /etc/pebble/pebble.json sed -i 's#test/certs/localhost#/etc/pebble#' /etc/pebble/pebble.json
exit 0 exit 0

View File

@ -9,7 +9,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node: [16, 18, 20] node: [16, 18, 20, 22]
eab: [0, 1] eab: [0, 1]

View File

@ -1,3 +1,4 @@
.actrc
.vscode/ .vscode/
node_modules/ node_modules/
npm-debug.log npm-debug.log

View File

@ -27,6 +27,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
# Changelog # Changelog
## v5.3.1
* `fixed` Allow `client.auto()` being called with an empty CSR common name
* `fixed` Bug when calling `updateAccountKey()` with external account binding
## v5.3.0 (2024-02-05) ## v5.3.0 (2024-02-05)
* `added` Support and tests for satisfying `tls-alpn-01` challenges * `added` Support and tests for satisfying `tls-alpn-01` challenges

View File

@ -59,9 +59,8 @@ module.exports = async function(client, userOpts) {
*/ */
log('[auto] Parsing domains from Certificate Signing Request'); log('[auto] Parsing domains from Certificate Signing Request');
const csrDomains = readCsrDomains(opts.csr); const { commonName, altNames } = readCsrDomains(opts.csr);
const domains = [csrDomains.commonName].concat(csrDomains.altNames); const uniqueDomains = Array.from(new Set([commonName].concat(altNames).filter((d) => d)));
const uniqueDomains = Array.from(new Set(domains));
log(`[auto] Resolved ${uniqueDomains.length} unique domains from parsing the Certificate Signing Request`); log(`[auto] Resolved ${uniqueDomains.length} unique domains from parsing the Certificate Signing Request`);

View File

@ -261,7 +261,7 @@ class AcmeClient {
const accountUrl = this.api.getAccountUrl(); const accountUrl = this.api.getAccountUrl();
/* Create new HTTP and API clients using new key */ /* Create new HTTP and API clients using new key */
const newHttpClient = new HttpClient(this.opts.directoryUrl, newAccountKey); const newHttpClient = new HttpClient(this.opts.directoryUrl, newAccountKey, this.opts.externalAccountBinding);
const newApiClient = new AcmeApi(newHttpClient, accountUrl); const newApiClient = new AcmeApi(newHttpClient, accountUrl);
/* Get old JWK */ /* Get old JWK */

View File

@ -299,7 +299,6 @@ describe('client.auto', () => {
it('should order san certificate', async () => { it('should order san certificate', async () => {
const [, csr] = await acme.crypto.createCsr({ const [, csr] = await acme.crypto.createCsr({
commonName: testSanDomains[0],
altNames: testSanDomains altNames: testSanDomains
}, await createKeyFn()); }, await createKeyFn());