Http request - Use SSL/TLS Connection

Hi all,

I'm trying to do a simple get request. The base url is : https://geodes.santepubliquefrance.fr/GC_indic.php?lang=fr&prodhash=123456789&indic=tx_pe_gliss&dataset=sp_ti_tp_7j&view=map2&filters=semaine_glissante=2020-11-30-2020-12-18.

This should give you back a json file. When you call this url through the browser or postman it work properly, but through the http-request node I got something ununderstandable.

I think I need to enable and specify the secure (SSL/TLS) connection. I don't know how to do that.
Does anyone have a tutorial for that ? How to build the files ?

Thanks a lot.

.Christian

[{"id":"cb7b703.2f2289","type":"http request","z":"601312ef.b153fc","name":"Build & Do Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://geodes.santepubliquefrance.fr/GC_indic.php?lang=fr&prodhash={{{random}}}&indic=tx_pe_gliss&dataset=sp_ti_tp_7j&view=map2&filters=semaine_glissante=2020-11-30-{{{date}}}","tls":"","persist":false,"proxy":"","authType":"","x":530,"y":1060,"wires":[["a8fcfd0f.7c808"]]},{"id":"b6237e30.7c5e5","type":"moment","z":"601312ef.b153fc","name":"Date today","topic":"","input":"","inputType":"date","inTz":"Europe/Paris","adjAmount":"0","adjType":"days","adjDir":"subtract","format":"YYYY-MM-DD","locale":"fr_FR","output":"date","outputType":"msg","outTz":"Europe/Paris","x":350,"y":1060,"wires":[["cb7b703.2f2289"]]},{"id":"a8fcfd0f.7c808","type":"debug","z":"601312ef.b153fc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":690,"y":1060,"wires":[]},{"id":"e2d78d08.3c68e","type":"inject","z":"601312ef.b153fc","name":"Trigger Manual","props":[{"p":"payload"},{"p":"random","v":"","vt":"date"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":1060,"wires":[["b6237e30.7c5e5"]]}]

It seems that you need to expose your node-red to the internet.

I don't think it is an ssl issue. I can't run your flow as it requires a non-core node that I do not have installed. If you configured an inject node to feed the url in then that would be better. In future if posting a flow please use the </> button.
You say you get something not understandable, can you show us what you get?

[Edit] I can't get it to work either, it is sending back a binary buffer. I thought it might need a user-agent string but that doesn't seem to help, so I am out of ideas.

Thanks for your feed back.

This is my workflow, I just remove a date generator node which isn't a core node. Now all is in the inject node.

[{"id":"55666d2.b37d494","type":"debug","z":"601312ef.b153fc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":1120,"wires":[]},{"id":"a208787b.0e0248","type":"http request","z":"601312ef.b153fc","name":"Build & Do Request","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://geodes.santepubliquefrance.fr/GC_indic.php?lang=fr&prodhash={{{random}}}&indic=tx_pe_gliss&dataset=sp_ti_tp_7j&view=map2&filters=semaine_glissante=2020-11-30-{{{date}}}","tls":"","persist":false,"proxy":"","authType":"","x":370,"y":1120,"wires":[["55666d2.b37d494"]]},{"id":"fc587a2.f4a4988","type":"inject","z":"601312ef.b153fc","name":"Trigger Manual","props":[{"p":"payload"},{"p":"random","v":"","vt":"date"},{"p":"date","v":"2020-12-21","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":1120,"wires":[["a208787b.0e0248"]]}]

The server send me back a binary buffer.

I also have made some tests with a WAMP plateform. Initially I had the same results as on nodered but after seeing the SSL parameters configured it works. That's why I think this is the right thing to do. The problem is, I don't know how to do it on node-red ...

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