I have an insecure connection to a localhost port for a third party application that runs a client api.
The request made to said api need to be made using the HTTPS protocol, otherwise the request will not be processed.
Using curl on the localhost url, offers us the following error:
curl: (60) schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Using Node to make the request issues this error:
Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
at TLSSocket.emit (node:events:519:28)
at TLSSocket._finishInit (node:_tls_wrap:1085:8)
at ssl.onhandshakedone (node:_tls_wrap:871:12) {
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
}
I can probably get localhost certificates, and that would solve my problem.
But I am supposed to be writing production ready code, so my solution of adding certificates probably would not do so well in other places.
I have tried the solutions offered on This Stack Overflow Question, but none worked for me for various reasons.
Is there a obvious solution to my predicament?