TLS error of self-signed certificate when using certificates and key from IBM Certificate Manager

627 views Asked by At

I have created a certificate using IBM Certificate Manager which provides me with a cert.pem, cert.key and cert_intermediate.pem files. I'm including them in a NodeJS app using the request library. I take the files, convert them to a single string with \n after each line and include them in the headers "ca" (using the content of cert_intermediate.pem), "cert" (using the content of cert.pem) and "key" (using the content of cert.key).

When I make a request, I get the following error:

{ Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (_tls_wrap.js:1088:34)
at TLSSocket.emit (events.js:198:13)
at TLSSocket._finishInit (_tls_wrap.js:666:8) code: 'SELF_SIGNED_CERT_IN_CHAIN' }

What could I be doing wrong?

Thanks, Troy

1

There are 1 answers

1
Tantre On

A client should not be familiar with private keys and certificates! They are server assets.
You need to use your certificates and private key in your server configuration.
In a client request, you may use an intermediate certificate, and this needed only if the client doesn't have your root ca