Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TLS support #20

Closed
juzam opened this issue Jan 24, 2018 · 5 comments
Closed

add TLS support #20

juzam opened this issue Jan 24, 2018 · 5 comments
Labels

Comments

@juzam
Copy link

juzam commented Jan 24, 2018

at the moment the node can't connect to a home assistant instance secured by TLS.
specifying the url as https://hostname:8123 just throws a generic {error} in Node-Red debug window.

this is a node-home-assistant issue in fact. the version installed via NR built in palette uses axios as a client for http requests. (please advise if I have to open a separate issue)

Unfortunately I can't figure out how to patch in https/tls support (axios supports it (axios/axios#12) but the documentation is not clear to me) otherwise I'd have directly sent a PR, sorry.

@AYapejian
Copy link
Owner

Interesting, I expose home-assistant and use node-red behind the firewall connecting to ha insecurely on the private network so I never thought of testing this ( assumed it'd work ). Sorry about that I'll take a look

@AYapejian AYapejian added the bug label Jan 28, 2018
@adamcstephens
Copy link

TLS works for me out of the box. I use a Let's Encrypt cert on my Home Assistant.

Perhaps this is a CA root trust issue ?

@juzam
Copy link
Author

juzam commented Jan 30, 2018

@adamcstephens Uhm, no I don't think so, my Home assistant has a Let's Encrypt cert as yours do.

but this leads me to get the bigger picture. My Error could be something completely unrelated to HA being accessed via https.

I'll have to do some tests in a separate environment to check my thesis but this could be the culprit:

  // The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot',
    // to apply the same root to both parts.
    httpRoot: '/admin',

I have this setting in my settings.js and it broke things in the past. If I recall correctly this node exposes some http endpoints in order to work properly but I think it doesn't take count of httpAdminRoot (I think this is the correct variable since the endpoints are not to be accessed/consumed outside the node-red editor by the node itself)

I'll check back when I've done proper tests.

Thank you for taking the time to look into this.

@walthowd
Copy link

TLS also works out of the box for me. Node Red 0.17.5, Let's Encrypt cert on Home Assistant 0.61.

@juzam
Copy link
Author

juzam commented Jan 30, 2018

Well it turns out that it was all my fault.

It wasn't any setting that I had in settings.js and @adamcstephens was almost right. i've recently changed the fqdn of the home assistant host and consequently changed the let's encrypt certificate. but I was addressing the host by the old fqdn (that resolvs to the same ip).
this resulted in a mismatch and hence the {error} i was seeing in the debug panel.

this is easily reproducible by pointing to the ip address of an tls protected ha instance.

I'm closing this. sorry for wasting your time.

@juzam juzam closed this as completed Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants