I am trying to convert der to pem using openssl M2Crypto library.
I am getting following exception for
p7 = SMIME.load_pkcs7_bio(raw_data)
Exception:
M2Crypto.SMIME.PKCS7_Error: 140605685806848:error:0D078089:asn1
encoding routines:ASN1_ITEM_EX_D2I:missing
eoc:tasn_dec.c:493:Type=PKCS7 140605685806848:error:0906700D:PEM
routines:PEM_ASN1_read_bio:ASN1 lib:pem_oth.c:83:
Related
using openssl command directly on prompt I can print the subject of a certificate directly to ASN.1 format:
openssl x509 -subject -noout -nameopt rfc2253 -nameopt dump_all -nameopt oid -nameopt sep_multiline -in mycertificate.cer
The certificate is:
-----BEGIN CERTIFICATE-----
MIIG6jCCBdKgAwIBAgIUMp1HU0W7iInXwAKycQieXr3Nl24wDQYJKoZIhvcNAQEL
BQAwcTELMAkGA1UEBhMCQlIxHDAaBgNVBAoTE09wZW4gQmFua2luZyBCcmFzaWwx
FTATBgNVBAsTDE9wZW4gQmFua2luZzEtMCsGA1UEAxMkT3BlbiBCYW5raW5nIFNB
TkRCT1ggSXNzdWluZyBDQSAtIEcxMB4XDTIyMDkyOTEyNDMwMFoXDTIzMTAyOTEy
NDMwMFowggEPMQswCQYDVQQGEwJCUjELMAkGA1UECBMCUkoxDzANBgNVBAcTBkxP
TkRPTjEcMBoGA1UEChMTT3BlbiBCYW5raW5nIEJyYXNpbDEMMAoGA1UEAxMDdHBw
MRcwFQYDVQQFEw40MzE0MjY2NjAwMDE5NzEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdh
bml6YXRpb24xEzARBgsrBgEEAYI3PAIBAxMCVUsxMzAxBgNVBGETKk9GQkJSLTc0
ZTkyOWQ5LTMzYjYtNGQ4NS04YmE3LWMxNDZjODY3YTgxNzE0MDIGCgmSJomT8ixk
AQETJDcyMThlMWFmLTE5NWYtNDJiNS1hNDRiLThjNzgyODQ3MGY1YTCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBANRjfdZJaqwfRB3IOL0OPpNaH6jqU97T
iNiOWDYN8sd/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N0aXR1dGVzIGFjY2VwdGFuY2Ug
b2YgdGhlIFJhaWRpYW0gU2VydmljZXMgTHRkIENlcnRpY2ljYXRlIFBvbGljeSBh
bmQgcmVsYXRlZCBkb2N1bWVudHMgdGhlcmVpbi4wSwYIKwYBBQUHAgEWP2h0dHA6
Ly9yZXBvc2l0b3J5LnNhbmRib3gucGtpLm9wZW5iYW5raW5nYnJhc2lsLm9yZy5i
ci9wb2xpY2llczANBgkqhkiG9w0BAQsFAAOCAQEAMbqpPqhVeuUs6tPUCk6XdYGl
Ofh6OpMLD1X58cGAWLx4DjEYva9dUecQ2FebyYoizyChawKrexNUI4pKkoPWPrWd
TnlEKma9cjPUMuWVa2ZrMz/gzl1tSD8sSY8ZM7/72JT8GhbgCxBz0+qlITyD+myk
4ekJUHMm2/7/bwR4T73HctJ7Y8AorjdSRUNF6CSh/R1NUhWoycg7vJ2tH+Hj/mUk
kzO4I08v/5P5kfRMkofSSH6vRh1zJfYq2/uvpZpFj7/LMar8o5MYRuPFxKifRsr/
vL8HmergQjPtpAnUF8YJpg63AxjKSgfhM9KisaUN6i2/jrhCvz3pAIUzLXBr7w==
-----END CERTIFICATE-----
The output of the command above is:
subject=
0.9.2342.19200300.100.1.1=#132437323138653161662D313935662D343262352D613434622D386337383238343730663561
2.5.4.97=#132A4F464242522D37346539323964392D333362362D346438352D386261372D633134366338363761383137
1.3.6.1.4.1.311.60.2.1.3=#1302554B
2.5.4.15=#131450726976617465204F7267616E697A6174696F6E
2.5.4.5=#130E3433313432363636303030313937
2.5.4.3=#1303747070
2.5.4.10=#13134F70656E2042616E6B696E672042726173696C
2.5.4.7=#13064C4F4E444F4E
2.5.4.8=#1302524A
2.5.4.6=#13024252
I'm trying to get a similar output using NodeJS, but without success... I've tried X509Certificate from crypto, ans1js, pk1js, but haven't success.
Is there a way to get the values using Node?
Thx
As mentioned in the comment, the best way is to use https://nodejs.org/api/crypto.html#x509subject
The output is a string and is perfectly parsable
This is an ordered collection of key/values ('=' separating key from value and '\n' separating each key/value)
The ouput for your certificate is:
C=BR
ST=RJ
L=LONDON
O=Open Banking Brasil
CN=tpp
serialNumber=43142666000197
businessCategory=Private Organization
jurisdictionC=UK
organizationIdentifier=OFBBR-74e929d9-33b6-4d85-8ba7-c146c867a817
UID=7218e1af-195f-42b5-a44b-8c7828470f5a
This is the human readable form of the component subject of your certificate encoded here as an ASN.1 value (search for subject rdnSequence)
Note that ASN.1 format is not a thing ...
I am using the Imagecodecs Python library to convert TIFF files to JPEG files and one of my images are causing an error in the program. When it gets to the file I get the following error. Anyone know why I would be getting this?
Exception has occurred: ValueError
TIFF_DECODE: Sorry, can not handle image
PNG_DECODE: not a PNG image
GIF_DECODE: DGifCloseFile returned 'Data is not in GIF format'
WEBP_DECODE: WebPGetFeatures returned VP8_STATUS_BITSTREAM_ERROR
JPEG8_DECODE: Not a JPEG file: starts with 0x49 0x49
JPEG12_DECODE: Not a JPEG file: starts with 0x49 0x49
JPEGSOF3_DECODE: decode_jpegsof3 returned 'JPEG signature 0xFFD8FF not found'
JPEG2K_DECODE: not a J2K or JP2 data stream
JPEGLS_DECODE: charls_jpegls_decoder_read_header returned Invalid JPEG-LS stream, the leading start byte (0xFF) for a JPEG marker was not found
JPEGXR_DECODE: PKCodecFactory_CreateDecoderFromBytes returned WMP_errUnsupportedFormat
JPEGXL_DECODE: DecodeBrunsli returned 0
LERC_DECODE: lerc_getBlobInfo returned Failed
NUMPY_DECODE: not a numpy array
The code that is causing this is:
imwrite(filepath[:-4] + '.jpg', imread(filepath)[:,:,:3].copy())
I am trying to push my docker image to Google Cloud Registry but get a 509 error say the certificate signed by unknown authority. This never used to be a problem and I can't seem to fix the issue. Any help is appreciated.
I'm running
docker -- push gcp.io/project/registry
Error
Get https://gcp.io/v2/: x509: certificate signed by unknown authority
I'm on Mac OS.
Update: you have a typo, you need to go to gcr.io, not gcp.io.
[ Original answer ]
Looks like a certificate issue on gcp.io:
$ openssl s_client -showcerts -connect gcp.io:443 </dev/null
CONNECTED(00000003)
depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.gcp.io
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.gcp.io
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.gcp.io
i:C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
-----BEGIN CERTIFICATE-----
MIIF6jCCBNKgAwIBAgIRAPLbl+CLddoCWmMcKSzPAT8wDQYJKoZIhvcNAQELBQAw
gY8xCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE3MDUGA1UE
AxMuU2VjdGlnbyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
QTAeFw0xOTExMjUwMDAwMDBaFw0yMDExMjQyMzU5NTlaMFUxITAfBgNVBAsTGERv
bWFpbiBDb250cm9sIFZhbGlkYXRlZDEdMBsGA1UECxMUUG9zaXRpdmVTU0wgV2ls
ZGNhcmQxETAPBgNVBAMMCCouZ2NwLmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAozq94VQqkxLR0qUqz6IM5/lY411MkLgrQhOR8Sg17EioEpudFKCV
FhC9N2Z8EFLpaGAxABpYM5JLWy1PpszOEETFswaS0Y/CpCnzW/SXtlH2ZOlGBXII
3LKP7ScfCgbwnndg820cA0XDNc54MUZcx2ebe2MZfFHKNhm+Lpqr4UZZu4ZaE8C6
9tcJaMC/znIWUpf+61aUJIQTYITL+NVB3zCeDhK0r29aLbz4K33TqN+9PJtwyTiS
8PZFTg93R8RCzdJD6x1lg3u7tAHGi6S3Omn7y3YtivTsA3iYbYIBm9i+0EHgpTOA
H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ALS137afCKUGa/e4PlFNTMqStP/anhv6byK+0bwh
jiqd9xuhjLmttf6zDelcmZPAZFuSL34khKnILPiXBsbiKFULiY1yEdpc4IpNLvZD
ys46g64+ss0sIqYR3vDPdoQmY3SUutxL7m2fwElGKGJIMFvkJ4+TUvNqAIsyQuEt
sIp/puDi8aEFhExywY1zrAeUuj4CJrCsHKZ25IIg
-----END CERTIFICATE-----
1 s:C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
i:C = SE, O = AddTrust AB, OU = AddTrust External TTP Network, CN = AddTrust External CA Root
-----BEGIN CERTIFICATE-----
MIIFdzCCBF+gAwIBAgIQE+oocFv07O0MNmMJgGFDNjANBgkqhkiG9w0BAQwFADBv
MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow
gYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtK
ZXJzZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMS4wLAYD
VQQDEyVVU0VSVHJ1c3QgUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjAN
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAgBJlFzYOw9sIs9CsVw127c0n00yt
UINh4qogTQktZAnczomfzD2p7PbPwdzx07HWezcoEStH2jnGvDoZtF+mvX2do2NC
tnbyqTsrkfjib9DsFiCQCT7i6HTJGLSR1GJk23+jBvGIGGqQIjy8/hPwhxR79uQf
jtTkUcYRZ0YIUcuGFFQ/vDP+fmyc/xadGL1RjjWmp2bIcmfbIWax1Jt4A8BQOujM
8Ny8nkz+r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GbkD4jylW6l/VXxRTrPBPYer3IsynVgviuDQf
Jtl7GQVoP7o81DgGotPmjw7jtHFtQELFhLRAlSv0ZaBIefYdgWOWnU914Ph85I6p
0fKtirOMxyHNwu8=
-----END CERTIFICATE-----
---
Server certificate
subject=OU = Domain Control Validated, OU = PositiveSSL Wildcard, CN = *.gcp.io
issuer=C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
---
No client certificate CA names sent
Peer signing digest: SHA512
Peer signature type: RSA
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 3435 bytes and written 424 bytes
Verification error: unable to verify the first certificate
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES128-GCM-SHA256
Session-ID: A1FB2B7B405094705F0DAFCAABA63B4E1ABDE5C122F2F3E5A7DE88ECB75AB617
Session-ID-ctx:
Master-Key: A0FB112FC9A33BD96E2346627A4E99A03F5C8AA404B19215EA3226A487B034E17EAC38AE0BD79C6B51E882BDC0DECE90
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1588527367
Timeout : 7200 (sec)
Verify return code: 21 (unable to verify the first certificate)
Extended master secret: no
---
DONE
And I see a similar error from curl -v https://gcp.io/v2/. This will need to be resolved by Google.
For the same cacert.pem openssl returns different results.
certificate verification fails in Redhat linux 8 but successfully verifies in Redhat linux 7.5
[rhel8]: openssl verify cacert.pem
C = NO, L = Asker, O = E1, OU = ETO TER, CN = ETO Opto Certificate Authority
error 18 at 0 depth lookup: self signed certificate
error cacert.pem: verification failed
RHEL 7.5:
[rhel7.5]: openssl verify cacert.pem
ca-certs.pem: C = NO, L = Asker, O = E1, OU = ETO TER, CN = ETO Opto Certificate Authority
error 18 at 0 depth lookup:self signed certificate
OK
In your case (a self signed cetificate), the 2 versions of openssl do not return the same code.
OpenSSL 1.0.2 returns 0
OpenSSL 1.1.1 returns 2
This is documented in the changelog:
Changes between 1.0.2h and 1.1.0 [25 Aug 2016]
[...]
*) Make openssl verify return errors.
Your version 1.0.2k is on the branch 1.0.2, and behaves as in 1.0.2h.
I have an express instance and an unencrypted pfx which contains my cert and an encrypted private key. When I load the pfx in express, I do not need to provide any sort of password, and it works. How is the node.js instance getting access to the private key? Isnt access to the unencrypted private key needed for https to work?
express code:
var httpsOptions = {
'pfx': fs.readfileSync('./cert.pfx'),
'passphrase': ''
};
https.createServer(httpsOptions, expressApp).listen(443, 'example.com');
My .pfx info from openSSL looks like the following:
openssl pkcs12 -in cert.pfx -info
MAC Iteration 2048
MAC verified OK
PKCS7 Encrypted data: XXXXXXXXXXXX, Iteration 2048
Certificate bag
Bag Attributes
localKeyID: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
subject=/OU=Domain Control Validated/CN=*.example.com
issuer=/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com,
Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure
Certificate Authority - G2
-----BEGIN CERTIFICATE-----
XXXXXXXXXXX=
-----END CERTIFICATE-----
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
Bag Attributes
localKeyID: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
Key Attributes: <No Attributes>
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,XXXXXXXXXXX
XXXXXXXXXXXXXXXX==
-----END RSA PRIVATE KEY-----
Turns out both the pfx itself and the private key within the pfx were stored unencrypted.
I mistakenly thought the private key within the pfx was encrypted because 1.) I was told it was and
2.) and because the openSSL package will not display the raw private key unless explicitly told to with the -nodes option
when openssl displays Enter PEM pass phrase: as it did above, it was asking for how to encrypt the displayed output: not how to decrypt the stored key, as I originally thought
The correct command I was looking for above was
openssl pkcs12 -in cert.pfx -info -nodes