SSL Certificate Setup - homeassistant and homebridge

Hi All, I’m loving this home assistant.
I have homeassistant/home-assistant Docker installed on my Synology 6 NAS, all working great.
I have an SSL certificate from Namecheap which secures my Synology, and i’d like to use the same certificate on the homeassistant, but can’t get it to work. The steps I’ve done are:

  • Copied the .cer and .key files into the config folder I share with the docker
  • Edited the http section of configuration.yaml and added
  • Port forwarded port 8123 from my router to my Synology

When I browse to https://mydomain:8123/ I get ERR_TUNNEL_CONNECTION_FAILED.

I’m no expert on SSL, so any pointers would be great.

1 Like

make sure docker/home assistant has read/write access to the files. also you can search through your home-assistant.log for anything with ERROR: and see if it tells you why or what failed. I have the same setup as you (HA, Docker, Synology DSM 6) with a Let’s Encrypt cert and I did exactly what you did to set it up. Post the full http: section of your configuration.yaml (scrub for PII and passwords first) with any error in your log.

Thanks for replying, I got it working now. Went back over the config I did, and i’d messed up the /config folder I’d shared with my Docker.

So now i’ve got my homeassistant Docker installed and working with SSL, I want to get homebridge working with my SSL homeassistant, so here’s what I’ve done:

  • Installed the marcoraddatz/homebridge Docker

Created an install.sh containing:

#!/bin/bash
npm install -g homebridge-homeassistant

Created a config.json:

{
	"bridge":
	{
		"name": "Homebridge",
		"username": "CC:22:3D:E3:CE:31",
		"port": 51826,
		"pin": "031-45-154",
		"manufacturer": "@nfarina",
		"model": "Homebridge",
		"serialNumber": "0.4.20"
	},
	"accessories": [ ],
	"platforms": [
	{
	    "platform": "HomeAssistant",
	    "name": "HomeAssistant",
	    "host": "https://mydomain:8123/",
	    "password": "MyPassword",
	    "supported_types": [
		"automation", 
		"binary_sensor", 
		"climate", 
		"cover", 
		"device_tracker", 
		"fan", 
		"group", 
		"input_boolean", 
		"light", 
		"lock", 
		"media_player", 
		"remote", 
		"scene", 
		"sensor", 
		"switch"
	],
	    "default_visibility": "visible",
	    "logging": true,
	    "verify_ssl": true
	}
	]
}

I get an error in the log:

at Object.onceWrapper (events.js:314:30)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-homeassistant/node_modules/request/request.js:1091:12)
at Request.emit (events.js:210:7)
at emitOne (events.js:115:13)
at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-homeassistant/node_modules/request/request.js:1171:10)
at Request.emit (events.js:213:7)
at emitTwo (events.js:125:13)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-homeassistant/node_modules/request/request.js:188:22)
at Request.request [as _callback] (/usr/local/lib/node_modules/homebridge-homeassistant/index.js:101:38)
at JSON.parse (<anonymous>)
SyntaxError: Unexpected token : in JSON at position 3

   ^
404: Not Found
undefined:1
e[37m[2017-9-18 19:59:48]e[39m Loading 0 accessories...
e[37m[2017-9-18 19:59:48]e[39m e[36m[HomeAssistant]e[39m Fetching HomeAssistant devices.
e[37m[2017-9-18 19:59:48]e[39m e[36m[HomeAssistant]e[39m Initializing HomeAssistant platform...
e[37m[2017-9-18 19:59:48]e[39m Loading 1 platforms...
e[37m[2017-9-18 19:59:48]e[39m ---
e[37m[2017-9-18 19:59:48]e[39m Loaded config.json with 0 accessories and 1 platforms.

Sorry, I don’t have home bridge setup on mine. I’d like to, but that’s a project for another time. A couple suggestions though: edit your post and put code and error logs in pre-formatted text (highlight code and error log text and click on the icon in the post editor that looks like </>), edit the title of this thread to include home bridge in it, or create a new thread as this post might get skipped over since the title doesn’t reflect it properly.

as for the error, look at the line:
SyntaxError: Unexpected token : in JSON at position 3

it looks like you have a random “:” in the config.json where it shouldn’t be. maybe in the first section following "bridge":?