You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My pem cert is a trust chain that begins with a subject, like this:
subject=CN=test-client, O=My Company, L=New York, S=New York, C=US
issuer=CN=My Company T3 001 Certificate Authority G1, DC=nyt, DC=net
-----BEGIN CERTIFICATE-----
MIIHRzCCBi+gAwIBAgITYwAAFnfJ+jbV6pZS7gAHAAAWdzANBgkqhkiG9w0BAQsF
...
Everything works well when I pass the cert via a file path, e.g.:
{
cert: './client.pem',
key: './client.key'
}
But if I pass the cert via a variable it crashes the app:
{
cert: CLIENT_CERT, // contains a pem cert with a subject as the first line
key: CLIENT_KEY
}
The reason is that the line testing if the variable contains the cert and not a path to the cert evaluates to false. The given cert does not start with -----BEGIN, but with subject=, so this test does not pass: !/^-----BEGIN/.test(self.options.ssl.cert.toString('utf8'))
Instead of treating the string as a cert, it erroneously treats it as a file path and attempts to use it to load the cert from disk.
The text was updated successfully, but these errors were encountered:
coolov
changed the title
A pem cert with distinguished name parameters can't be read from a variable
A pem cert with a subject can't be read from a variable
Aug 22, 2017
coolov
changed the title
A pem cert with a subject can't be read from a variable
A pem cert with multiple subjects can't be read from a variable
Aug 24, 2017
coolov
changed the title
A pem cert with multiple subjects can't be read from a variable
A pem cert with a trust chain can't be read from a variable
Aug 24, 2017
My pem cert is a trust chain that begins with a subject, like this:
Everything works well when I pass the cert via a file path, e.g.:
But if I pass the cert via a variable it crashes the app:
The reason is that the line testing if the variable contains the cert and not a path to the cert evaluates to false. The given cert does not start with
-----BEGIN
, but withsubject=
, so this test does not pass:!/^-----BEGIN/.test(self.options.ssl.cert.toString('utf8'))
Instead of treating the string as a cert, it erroneously treats it as a file path and attempts to use it to load the cert from disk.
The text was updated successfully, but these errors were encountered: