Curl commands, invalid certificate on 127.0.0.1

hi, i am have some shell commands that i run on 127.0.0.1, those are curl commands
but for some reason, they run slow, i think it has todo with ssl

so if i use
curl -k blalabla on 127.0.0.1 => it takes about 2-3 secs
if i do
curl -X on 127.0.0.1 => it gives me an error about invalid certificate
if i do
curk -X on my nabucasa url => its instant :slight_smile:

so how can i make my make my ssl work on 127.0.0.1 , so its also instant and internal ?

You can’t use IP addresses with SSL certs, it wont be valid, neither will any internal address you use. Importing the invalid cert may cause it to stop complaining and run faster. To actually get it to become valid you need to do messy stuff.

The only way you can trick it, and for 127.0.0.1, it’s going probably going to break things, is to put a hosts file on the server pointing your nabucasa url to 127.0.0.1. This will now render this machine unable to externally resolve this URL though, so as I said it will break stuff.

I, for a while, instead put a DNS entry on my home network pointing the external hostname to my internal IP which prevented router loopback being used (it was noticeably more responsive). This did cause me other messy issue that needed other workarounds; in the end I used Ariela which supports using different hostnames depending on whether its internal or external.

Ok, thnx for feedback and suggestions…
Well, for now I changed all curl commands with nabucasa url instead of 127.0.0.1… it works good enough, gonna leave it…

But I still don’t understand why it doesn’t work anymore , why I have that delay when I use the -k option to ignore ssl

It’s resolved now, I needed to add the -X option after -k , was not needed before it seems, now it’s instant again