node-acme-client icon indicating copy to clipboard operation
node-acme-client copied to clipboard

upgrade to 5.3.0 from 5.0.0 breaks CreateCsr()

Open gaurav-jotwani opened this issue 1 year ago • 1 comments

Call to function fails: const [key, csr] = await acme.crypto.createCsr({ commonName, altNames, });

commonName and altNames are both wild card domains Cannot get schema for 'Array' target","stack":"Error: Cannot get schema for 'Array' target\n at AsnSchemaStorage.get (/usr/src/app/node_modules/@peculiar/asn1-schema/build/cjs/schema.js:17:19)\n at AsnSerializer.toASN (/usr/src/app/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js:24:48)\n at AsnSerializer.toAsnItem (/usr/src/app/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js:152:33)\n at AsnSerializer.toASN (/usr/src/app/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js:52:48)\n at AsnSerializer.serialize (/usr/src/app/node_modules/@peculiar/asn1-schema/build/cjs/serializer.js:14:21)\n at AsnConvert.serialize (/usr/src/app/node_modules/@peculiar/asn1-schema/build/cjs/convert.js:10:43)\n at Pkcs10CertificateRequestGenerator.create (/usr/src/app/node_modules/@peculiar/x509/build/x509.cjs.js:2190:43)\n at async exports.createCsr (/usr/src/app/node_modules/acme-client/src/crypto/index.js:496:17)

gaurav-jotwani avatar Feb 28 '24 22:02 gaurav-jotwani

Hi, unable to reproduce this. What exactly are your commonName and altNames that are causing the error?

(async () => {
    const [key, csr] = await acme.crypto.createCsr({
        commonName: '*.example.org',
        altNames: ['*.example.org']
    });

    console.log(key.toString()); // works
    console.log(csr.toString()); // works
})();

nmorsman avatar Mar 18 '24 14:03 nmorsman