Just added my SSL certificates to Home Assistant. Everything seams to be working great now.
With one exception HomeBridge now can’t talk to HomeAssistant i updated my HomeBridge config to reflect the change in https trying both my local IP and my DDNS address.
I am receiving this error in HomeBridge
[HomeAssistant] Failed getting devices: Error: unable to verify the first certificate. Retrying…
Is this a limitation to the current HomeBridge plugin? Or is there a fix? Has anybody overcome this problem?
Do you get any SSL warnings when viewing Home Assistant in a browser? Are you using a self-signed certificate, Lets Encrypt certificate, or some other provider?
The error seems like it’s having problems verifying certificate, which could happen for self-signed for sure.
If anybody else runs into this problem it was solved by adding the contents from the .ca-bundled file to the bottom of the crt file received from Comodo.
I’m wondering what you mean with the .ca-bundled file. I have my SSL running by Let’s Encrypt. do you have any clue how i can solve it in this SSL setup?
@technicalpickles: Im not using a docker. So that would not work for me unfortunately.
I have a valid certificate signed to my DNS address. This works great with HA.
But in Homebridge I see this error, I think because its a local https address.
[HomeAssistant] Failed getting devices: Error: unable to verify the first certificate. Retrying...
This is the official solution but I’m not sure what to do. I start homebridge with systemd
Pls help
Using with self signed SSL certificates
If you have set up SSL using a self signed certificate, you will need to start Homebridge after running export NODE_TLS_REJECT_UNAUTHORIZED=0 to allow bypassing the Node.js certificate checks.
This is my homebridge config. With http everything works fine.
Nov 16 11:58:25 raspberrypi homebridge[482]: [11/16/2016, 11:58:25 AM] [HomeAssistant] Failed getting devices: Error: unable to verify the first certificate. Retrying...
Do I need to put my certificate on the Homebridge Pi, too?
Actually I want to use my local address, so I’m not dependent from my IPS, DNS server or expired certificates.
I simply modified the homebridge executable set up file .
This file is located here:
/usr/lib/node_modules/homebridge/bin
Just added the command: process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
Then the file look like this:
#!/usr/bin/env node
//
// This executable sets up the environment and runs the HomeBridge CLI.
//
'use strict';
process.title = 'homebridge';
// Find the HomeBridge lib
var path = require('path');
var fs = require('fs');
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
// Run HomeBridge
require(lib + '/cli')();
Now restart homebridge service. And the ssl errors are gone.
NOTE: THIS DISABLES ALL KINDS OF SECURITY CHECKS
I think everything is local if I put in the local home Assistant IP in config.json, so I hope this is not a big deal.
I dont know if this is the right way but this works for me and works this autostart and systemd service.
Following your instructions and still can’t solve it. Running it in debug mode shows Client connection closed, HTTP Connection was closed, HTTP Server was closed when Homebridge attempts to communicate with HomeAssistant.
I did this too in order to get homebridge to work, but it seems like a hack! @robbiet480 - is there a better way to get homebridge-homeassistant working with self-signed SSL (Let’s Encrypt)? and could you update the GitHub README so it says where to put the environment variable for systemd autostart scripts?
If you have set up SSL using a self signed certificate, you will need to to set verify_ssl to false in your config.json file to allow bypassing the Node.js certificate checks.