Skip to content
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

x509 unknown option -utf8 #214

Closed
Gi60s opened this issue Sep 14, 2018 · 2 comments
Closed

x509 unknown option -utf8 #214

Gi60s opened this issue Sep 14, 2018 · 2 comments

Comments

@Gi60s
Copy link

Gi60s commented Sep 14, 2018

Seeing an error that says that openssl x509 does not know the option -utf8. Our code runs find using NPM package version 1.12.7, but fails starting at version 1.12.8 and upward.

Here is our code:

pem.getPublicKey(cert, (err, data) => {
    if (err) {
        console.error(err.message)
    } else {
        console.log(data.publicKey)
    }
})

This is the error:

Invalid openssl exit code: 1
% openssl x509 -utf8 -in /tmp/45f2bffa2f2323bca8486b190548a366800f56b3 -pubkey -noout
unknown option -utf8
usage: x509 args
 -inform arg     - input format - default PEM (one of DER, NET or PEM)
 -outform arg    - output format - default PEM (one of DER, NET or PEM)
 -keyform arg    - private key format - default PEM
 -CAform arg     - CA format - default PEM
 -CAkeyform arg  - CA key format - default PEM
 -in arg         - input file - default stdin
 -out arg        - output file - default stdout
 -passin arg     - private key password source
 -serial         - print serial number value
 -subject_hash   - print subject hash value
 -subject_hash_old   - print old-style (MD5) subject hash value
 -issuer_hash    - print issuer hash value
 -issuer_hash_old    - print old-style (MD5) issuer hash value
 -hash           - synonym for -subject_hash
 -subject        - print subject DN
 -issuer         - print issuer DN
 -email          - print email address(es)
 -startdate      - notBefore field
 -enddate        - notAfter field
 -purpose        - print out certificate purposes
 -dates          - both Before and After dates
 -modulus        - print the RSA key modulus
 -pubkey         - output the public key
 -fingerprint    - print the certificate fingerprint
 -alias          - output certificate alias
 -noout          - no certificate output
 -ocspid         - print OCSP hash values for the subject name and public key
 -ocsp_uri       - print OCSP Responder URL(s)
 -trustout       - output a "trusted" certificate
 -clrtrust       - clear all trusted purposes
 -clrreject      - clear all rejected purposes
 -addtrust arg   - trust certificate for a given purpose
 -addreject arg  - reject certificate for a given purpose
 -setalias arg   - set certificate alias
 -days arg       - How long till expiry of a signed certificate - def 30 days
 -checkend arg   - check whether the cert expires in the next arg seconds
                   exit 1 if so, 0 if not
 -signkey arg    - self sign cert with arg
 -x509toreq      - output a certification request object
 -req            - input is a certificate request, sign and output.
 -CA arg         - set the CA certificate, must be PEM format.
 -CAkey arg      - set the CA key, must be PEM format
                   missing, it is assumed to be in the CA file.
 -CAcreateserial - create serial number file if it does not exist
 -CAserial arg   - serial file
 -set_serial     - serial number to use
 -text           - print the certificate in text form
 -C              - print out C code forms
 -md2/-md5/-sha1/-mdc2 - digest to use
 -extfile        - configuration file with X509V3 extensions to add
 -extensions     - section from config file with X509V3 extensions to add
 -clrext         - delete extensions before signing and input certificate
 -nameopt arg    - various certificate name options
 -engine e       - use engine e, possibly a hardware device.
 -certopt arg    - various certificate text options

Line of code that broke this: https://github.com/Dexus/pem/blob/master/lib/pem.js#L487

@Dexus Dexus closed this as completed in 4d10fb2 Sep 14, 2018
Dexus pushed a commit that referenced this issue Sep 14, 2018
## [1.13.1](v1.13.0...v1.13.1) (2018-09-14)

### Bug Fixes

* **package:** remove -utf8 option ([4d10fb2](4d10fb2)), closes [#214](#214)
@Dexus
Copy link
Owner

Dexus commented Sep 14, 2018

🎉 This issue has been resolved in version 1.13.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Gi60s
Copy link
Author

Gi60s commented Sep 14, 2018

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants