400 No required SSL certificate was sent

Hello,

I try to execute API in http request and I receive this message

""400 No required SSL certificate was sent""

please what means ?

Hi @rabah.tamezait, welcome to the forum. Did you try googling for that error? It appears that the API requires you to send a certificate.

Hello,
Thank you, yes i tried in google, But i didn't resolve problem
do you have some methodes or link ?

Does the API documentation say that it needs a certificate?

YES THAT does certification, i have certification .pfx
but I don't know, how to make it in node-red ?
Thank you

Hi Rabah,

So I assume you want to do the following:

  1. You call an API via the http-request node
  2. The called server requires a client-side certificate, to make sure you can authenticate yourself.

So you want to store the client certificate in a (pfx) container, and you want the http-request node to get it there (and send it to the server). Is that correct?

I have the impression that this is currently not possible in Node-RED, but perhaps this might get you started:

  • The http-request node is based on the request npm package.
  • In that package you can see that a client-side certificate can be supplied via the AgentOptions.
  • However when you look at the http-request node, you will see that the AgentOptions are NOT being used. So I don't think it is supported in Node-RED at the moment.
  • And I'm not sure whether this will be added (based on this discussion) to the http-request node, because the "request" npm package is obsolete. This is a known issue, but there is no solution yet (as you can read in this issue). So extending the http-request node further, might make a migration to another package even more difficult. But perhaps others have a different opinion about this ...

To be honest, if I was in your case I would do the http request from a function node. In this StackOverflow discussion, there is a simple example of a http request with client certificate. The example requires no extra npm packages, but only standard NodeJs stuff.

Note that I haven't tried this code myself!

Bart

1 Like

Why not tick the 'use https' option in the node and provide the appropriate certs in the TLS config node? Probably much easier to use the functionality already provided by the node then go off editing code. Unless I'm missing something about the scenario?

2 Likes

Damn... Believe it or not, but I did never had a look at that config screen before ...
Nice !!

Hello,
Thank you for your explanations, I will try every suggestions.

1 Like

Hello,
Thank you for your réponses, i tried to use certs, But i have juste pfx....Can I obtain the certs, key private...JUSTE WITH PFX ???

Sorry, not an tls expert, but that does sound like the type of question Google could help you answer.

For example: https://tecadmin.net/extract-private-key-and-certificate-files-from-pfx-file/

1 Like

Thank you for yours réponses, But for now i miss CA Certificate in the node.

I don't know how i obtain it, if you any idea , thank you

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.