Continue Discussion 202 replies
February 2018

Matthew_Noecker

I have followed the above instructions but am receiving the error below and can not start the addon

this is what is in my options:
{
“lets_encrypt”: {
“accept_terms”: true,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
},
“token”: null,
“domains”: [
null
],
“seconds”: 300
}

And this is the error I get:

not a valid value for dictionary value @ data[‘options’]. Got {‘lets_encrypt’: {‘accept_terms’: True, ‘certfile’: ‘fullchain.pem’, ‘keyfile’: ‘privkey.pem’}, ‘token’: None, ‘domains’: [None], ‘seconds’: 300}

3 replies
February 2018 ▶ Matthew_Noecker

balloob Founder of Home Assistant

You don’t have the correct value for domains. Check the docs

February 2018 ▶ Matthew_Noecker

Morten_DK

Did you get this solved? If so how? I get that it seems to be missing domains, but how is that created?

1 reply
February 2018 ▶ Morten_DK

Bobby_Nobble

Like @balloob said, follow the docs and insert the token and domain you generate at DuckDNS.org, @Matthew_Noecker just left them as ”null”.

1 reply
February 2018

Antasp3136

I had duckdns setup and had configured letsencrypt. It worked but I’m not a big fan of duckdns. No real control of my DNS name. So I looked for a better option. Google domains. Not free only 12 dollars a year but they support the dyndns protocol so you can use your own domain name for accessing your network. You can create subsites and forwards. You can also use the DNS txt records to get a letsencrypt SSL certificate as well. To me the 12 dollars is well worth it!

1 reply
February 2018 ▶ Antasp3136

grahamr

That sounds slick - any chance you could do a more detailed write up?

1 reply
February 2018

chrisw

I actually used this article to setup SSL on my OMV NAS and then scripted utilities to convert & push the certificate to my LEDE router, Emby and a few other things I wanted to use with SSL.

February 2018 ▶ Bobby_Nobble

Morten_DK

Okay - thanks. I was just in doubt of whether to do anything on duckdns first or that also was a part of the add-on. Reading only the blog suggested the latter.

Do I still need to do some port forwarding or is it only opening ports that is not needed (or is those two the same)?

1 reply
February 2018 ▶ Morten_DK

Bobby_Nobble

Yep, if you have ‘base_url:’ with the port number on the end you’ll need to forward 8123 to 8123 on your pi, if you have just the duckDNS address with no port it’s 443 to 8123.

February 2018 ▶ grahamr

Antasp3136

Sure, Just fyi… im not the best at explaining step by step but here we go… its really simple first go to https://domains.google.com and setup your domain that you want. Then once you log in you with click on the dns icon…

Then scroll down to synthetic records and choose the dynamic dns setting from the dropdown…

This will allow you to create a subdomain… so like homeassistant.yourdomain.com

Once that is created you will get a generated username and password. These will be used to setup the dyndns service on your home router.

As long as your router support the dyndns service you will choose that and then for the server address you will enter in domains.google.com then use the username and password from your custom domain subsite…

After this is setup and working you then can use any of letsencrypts online tool to verify the domain. I used https://www.sslforfree.com/ you want to add your main domain yourdomain.com and any subsite… homeassistant.yourdomain.com to the list of sites you want included in the ssl certificate. Then you can use the option to verify the domain by dns txt record. The site will pretty much walk you through what to do. Once you get the dns txt record you will add this to the custom resource records on your google domain. Dont worry about the TTL googles default is 1h but it takes less than that to verify. After that you can copy the cert and key txt into a seperate txt doc and save it as a pem file for home assistant. After you do that you just need to copy those files to the correct location and you should be able to get up and running. You can use the same cert for any other systems you have running on your network as long as the site and subsites are in there.

1 reply
March 2018

petermj

I have installed duckdns and configured it according t the instructions here and other places.

It basically works for me using ssl/htps everywhere but on the iOS home assistant app. When using the app I get an invalid certificate message and the app refuses to connect. I have imported the full chain.pem file to my iPhone and allowed it to be used for SSL, but the app still fails to connect and shows the same error.

Is there anyone else out there with this problem? Is there anyone out there with a working iOS app using duckdns and SSL? If so, did you do anything special to make it work?

Thank you.

1 reply
March 2018 ▶ Antasp3136

thakkar.rahul

@Antasp3136,

Thanks for the above guide. I followed the steps and was able to get the cert files. You mentioned about the correct location of the file. Does it need to be in specific location?

Also there were 3 cert files, which one are we to use?

I get error that HA can’t access pem files in config folder.

Please help
Thanks

1 reply
March 2018

FiServedPi

My HA PI is hard lined into my Google WiFi router but I also have an ISP modem which external ip address am I supposed to use my ISP? Or the Google WiFi

1 reply
March 2018

Phazed

I am hoping to find a poiner to why I can’t get SSL to work.
I have a static IP and my own domain.
Installed the LetsEncrypt addon.
Setup NAT from MyStaticIP:447->hassio:8123 (that is not a typo, 443 is in use)
https://hasio.local:8123 works correctly
SSLChecker says the certificates are valid and tcpdump shows the cert being passed when a request comes in on https://MyDomain.com:447
But if I go to https://MyDomain.com:447 from outside my network, I always get:

   Home Assistant had trouble
   connecting to the server.
   TRY AGAIN

Which must be coming from something running on the Pi. I’ve tried a number of things in the http section of the config file. Currently it looks like:

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  # server_port: 8123
  # Secrets are defined in the file secrets.yaml
  api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123
  base_url: https://MyDomain.com:447

How do I get past this?.

1 reply
March 2018 ▶ Phazed

JTPublic

My let’s encrypt is using 443 and from outside my lan, it just use https://domain_name.com, without port number.

1 reply
March 2018 ▶ JTPublic

Phazed

443 is in use on that address so I’m using 447

March 2018 ▶ FiServedPi

Bobby_Nobble

You’ve only got one external IP address but you don’t need it to set this up, that’s what duckdns looks after for you.

March 2018

Phazed

I run my own DNS servers and have static IP addresses - No DuckDNS here.

The problem appears to be that Home Assistant is not quite correct in it’s html and this causes lynx to fail. I was using lynx to test so that I could see how things work from an out of state machine.

I’ll try to file a bug on this.

The whole objective was to get Google Assistant to work and it still fails.

March 2018 ▶ thakkar.rahul

Antasp3136

i changed the default location of my cert files… the one you need is the key and the chain file. As soon as i added those to the folder i specified in my configuration file it picked up and everything worked fine. You added the root and sub domain name when you created your cert right? So prefix.domain.com and domain.com that should allow the cert to work.

1 reply
April 2018

robmarkcole Great contributor

I’m afraid I still wouldn’t describe this process as effortless. 1 hour with multiple restart, HASSIO just presenting a blank screen, SSH to reboot over and over, still not working. :sweat_smile:

1 reply
April 2018 ▶ robmarkcole

Bobby_Nobble

Take this the right way but, after the initial missing instructions from the article about port forwarding etc were cleared up, it really is effortless BUT heavily relies on first, you do everything exactly as instructed and second, your instance of HA, hardware and network are all exactly as the setup expects, the latter is where most people’s problems lie.

1 reply
April 2018 ▶ Bobby_Nobble

robmarkcole Great contributor

Hi @Bobby_Nobble if we can troubleshoot my issues then I am happy to help fine tune the docs?

I’m on a pi-zero with hassio running 0.67. I’ve got router port 8123 mapped to 8123 on the pi. I’ve documented my issues in this thread.

My issues are related to the .pem files which I recall previously could only be generated by opening ports temporarily. However the new process doesn’t require this, so my first question is:

cheers

1 reply
April 2018 ▶ robmarkcole

Bobby_Nobble

Hi @robmarkcole, just had a look at your linked thread and it looks like you’re in the first camp :slight_smile: …you have no base_url in your config!

Given you’ve forwarded 8123 to 8123, your config should be like this…

http:
  base_url: https://your_chosen_name.duckdns.org:8123
  api_password: !secret http_password
  login_attempts_threshold: 5
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem 

…and you’d access HA externally at https://your_chosen_name.duckdns.org:8123

1 reply
April 2018 ▶ Bobby_Nobble

robmarkcole Great contributor

Hi bobby, I tried that (there’s a discrepancy between the docs and the blog post about whether it’s required), without success

1 reply
April 2018 ▶ robmarkcole

Bobby_Nobble

It stated quite clearly in the default configuration.yaml you had when first installing HA to uncomment that line if you wanted to access HA externally!

Literally all I did was put this in my config…

http:
  base_url: https://my_chosen_name.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  api_password: my_HA_password

installed the DuckDNS addon, set it like this…

{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "my_token_from_duckdns",
  "domains": [
    "my_chosen_name.duckdns.org"
  ],
  "seconds": 300
}

and I forwarded 8123 to 8123 on my router, nothing else whatsoever and it works perfectly.

I consider that fairly effortless :slight_smile:

1 reply
April 2018

JS1

For some reason I had to manually create the ssl folder to get it to work. I did find that when using duckdns, tts on Google home stops working :frowning: I checked NAT loopback is turned on but it didn’t help.

1 reply
April 2018 ▶ JS1

robmarkcole Great contributor

Where did you create the ssl folder?

2 replies
April 2018 ▶ robmarkcole

JS1

I created the SSL folder in the config folder, I’m using Hassio. I did it because HA wouldn’t start up and it seemed to be because the SSL files were missing (sorry I can’t remember the exact error) … anyway I added an SSL folder and everything worked; I could connect using SSL via my duckdns address (after setting up some port forwarding on my router). The really strange thing is that when I look in my SSL folder there is nothing there!

1 reply
April 2018 ▶ JS1

robmarkcole Great contributor

That’s strange. If you’re prepared to try it out, does deleting the ssl folder have any effect?

1 reply
April 2018 ▶ robmarkcole

JS1

I’ll have a go!

April 2018 ▶ robmarkcole

DavidFW1960

mine are in /ssl/

if you use winscp, navigate to root and you will see a ssl folder. Thats where my certificates live.

April 2018

robmarkcole Great contributor

OK so I’ve confirmed that the ssl directory exists and the keys are present:

core-ssh:~# pwd
/root
core-ssh:~# cd /ssl
core-ssh:/ssl# ls
fullchain.pem  privkey.pem

My config is as per the docs:

http:
  api_password: !secret http_password
  base_url: https://my_domain.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

Finally, I’ve also noticed that the default options from the docs page apparently aren’t actually valid - appear to require the seconds to be configured:

I’ve selected RESET TO DEFAULTS and edited to give the following valid config:

{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "my_token",
  "domains": [
    "my_domain.duckdns.org"
  ],
  "seconds": 300
}

I am able to reach the HA front-end at https://192.168.0.28:8123/states. With hindsight it is obvious but I was not appending https. However my logs fill with the error:

2018-04-16 06:42:41 ERROR (MainThread) [homeassistant.core] Error doing job: Task was destroyed but it is pending!

Therefore there is an issue here, but the process does work. My PR to clarify the docs is here.

1 reply
April 2018

JS1

@robmarkcole OK so I tried again after deleting the /config/ssl/ folder I had added and by forwarding port 8123 on my router everything worked. I have since upgraded to hassio 0.67.0 so perhaps there was a bug before. I have confirmed that fullchain.pem and privkey.pem are in /ssl/ as @DavidFW1960 suggested.

I went through my search history and the error I originally got was Got ‘/ssl/fullchain.pem’ not a file for dictionary value @ data[‘http’][‘ssl_key’]

April 2018 ▶ robmarkcole

Bobby_Nobble

So exactly what I said then :rofl:

April 2018

leviweb

Just a another way to do that with automatic renew without port fowarding.
There is a simplest way to configure it without care about port forwarding or leave HAS on exposed on WAN just to do automatic renew.

July 2018 ▶ Bobby_Nobble

djsheetu

Just to say thank you.

I couldn’t forward external port 443 to internal port 8123 as my router (Netgear D6200) doesn’t have that capability strangely…

Using https://mydomain.duckdns.org:8123 and forwarding external port 8123 to ip.of.my.pi worked for me to access the HA externally.

I am also able to access the HA frontend by adding https:// and :8123 to my internal ip.

I have base url with https://mydomain.duckdns.org:8123 in my configuration.yaml file without the quotes.

I am using HASSIO with DuckDNS addon.

Just one small issue. I have the below error in my log files popping up every 10 seconds or so.

Error doing job: <uvloop.loop.SSLProtocol object at 0x6fe09c50>: SSL error errno:1 reason: HTTP_REQUEST
Traceback (most recent call last):
File “uvloop/sslproto.pyx”, line 496, in uvloop.loop.SSLProtocol.data_received
File “uvloop/sslproto.pyx”, line 204, in uvloop.loop._SSLPipe.feed_ssldata
File “uvloop/sslproto.pyx”, line 171, in uvloop.loop._SSLPipe.feed_ssldata
File “/usr/lib/python3.6/ssl.py”, line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:777)

I haven’t found any other issues yet.

Does anyone know if i need to be concerned? Thanks in advance.

August 2018 ▶ Antasp3136

WSmitty

Great tutorial. I may have missed something, how to get HASSio to update the Google Domain? It seems mine is pointed to my provider local office for some reason. This is what I have in my Config.yaml file
google_domains:
domain: homeassistant.***************.com
username: !secret google_domain_user
password: !secret google_domain_pass

Any suggestions?

1 reply
August 2018

sholofly

Hi all,

I had all working properly. During my holidays i guess my certificate expired. I was only able to access my setup without https. I figured ot that my duckdns add-on had stopped, but i’m not able to start it again. My logs on the add-on page is empty. Can someone help me out?

greets,

Rudolf

August 2018

theobeckum

I installed DuckDNS (and not let’s encrypt, because of the warning not to use them both).
I followed the instructions above for the configuration.yaml, but got this error when checking the config: invalid config for [http]: not a file for dictionary value @ data[‘http’] [‘ssl_certificate’] Got ‘/ssl/fullchain.pem’
And the same for the ssl_key.
What did I do wrong

1 reply
August 2018 ▶ WSmitty

Antasp3136

Not sure about that. Im not using homeassistant to update my DDNS ip. I use my router to do this using its built in DDNS features.

August 2018 ▶ theobeckum

sholofly

Did you set accept_terms:true in the lets encrypt settings?

September 2018

pjo

Not sure what has happened but since upgrading to 78.X I can’t get SSL to work

configuration.yaml:
    http:
      api_password: !secret http_password
      base_url: https://xyz.duckdns.org:8123
      ssl_certificate: /ssl/fullchain.pem
      ssl_key: /ssl/privkey.pem

duckdns config:
{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "e001dbdd-333e-4ee9-a7b7-7239de099325",
  "domains": [
    "xyz.duckdns.org"
  ],
  "seconds": 600
}

and this is the error in the log

2018-09-20 19:15:05 ERROR (MainThread) [homeassistant.core] Error doing job: SSL error errno:1 reason: HTTP_REQUEST
Traceback (most recent call last):
  File "uvloop/sslproto.pyx", line 504, in uvloop.loop.SSLProtocol.data_received
  File "uvloop/sslproto.pyx", line 204, in uvloop.loop._SSLPipe.feed_ssldata
  File "uvloop/sslproto.pyx", line 171, in uvloop.loop._SSLPipe.feed_ssldata
  File "/usr/local/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:841)

umm… any ideas anyone?

October 2018

cnschulz

Hi, Noob question: Does this process only work with *.duckdns.org addresses or can I use it to create certs for any domain I own? If so, is the process any different?

November 2018

Chewee

I believe I have followed it right, but I cant’ get https to work, http works fine.

This is the only error I can see…

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 242, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 519, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

any ideas? Thanks!

2 replies
November 2018

biiiink

Im having the exact same issue

November 2018

Valentin

Hi all,
I am new with Home Assistant and stil learning from the available documentation.
Trying to access hass.io from the internet I have followed the same steps as described in @Bobby_​​Nobble post from 15th April. The result is that now I can’t access UI neither from my home network neither from external.
Connection via ssh shows that HA is running. Also files fullchain.pem and privkey.pem are in /ssl folder.
Any hint or idea ? Thanks.

January 2019 ▶ Chewee

urgemore

Yep, I’ve been spinning my wheels over the apparent same issue as Chewee. Now it’s a month and a half later than Chewie having the problem,so…
Hey, Chewie, did you get that solved?

January 2019

greyno

Thanks to a blog post by Andreas Gohr I realized that DuckDNS supports setting TXT records, making it compatible with the DNS-01 challenge of Let’s Encrypt. The DNS-01 challenge is using the DNS record of the domain instead of interacting with the server. This means that it’s not needed for the user to open any ports!

But I DO have to forward a port on my router. What is meant by this passage?

January 2019

h4nc

One documentation I read guided you to first set up a test portforward (8123 → 8123) and later on advices you to delete that portforwarding and replace it with (443 → 8123).
Currently I can’t find that doc.

Whats the reason for this?

Is it more unsecure to open the port 8123 to the public than opening 443?

The advantage about the forwarding 8123 to 8123 is that it will be the same URL either in the local or in the public network.

When I change it to 443 → 8123 than I have to open XXX.duckdns.org in a public network and XXX.duckdns.org:8123 in my local network. Or is there a workarround for that?

So it makes no difference (thats my main question) if you chose 443 or 8123 than why use different ports?

EDIT:
This is the doc I was talking about.

headlines 5 - CHECK THE INCOMING CONNECTION and 6 - CLEAN UP PORT FORWARDS

In step 2 we created a port forwarding rule called ha_test . This opens port 8123 to the world, and is no longer necessary.

1 reply
January 2019 ▶ h4nc

Caine72

Last passage before section 1 mentions why.
It’s because he aims to get the default behavior of writing https which runs on port 443 instead of having to specify port each and every time.

Personally I have also seen that if you want to run home Assistant as progressive web app (I.e. it shows up as a app on your drawer) on Android. You need to run it on port 443 alt port forward 443 to HA port of choice.

From a local network standpoint you can still run the same https://xxx.duckdns.org address as externally.
This is because the router knows that the endpoint of that address is internal so it will just turn the traffic back around.

1 reply
January 2019

h4nc

But from a security point of view it’s the same, if you open 443 or some other port?
Or is it even more scure have an other port than 443 because it isn’t that obvious for a potential attack from a hacker?

I don’t care if I have to specify the port every time, because I save the url as bookmark, so I don’t have to care about that.
I just want to know if I’m doing it right. So are both ways ok or is one better than the other?

Are you sure about that, I tried it with port 443 but I wasn’t able to open it without the internal port at the end (local).
My router doesn’t support natloop-back maybe thats the issue?

1 reply
January 2019 ▶ h4nc

Caine72

Changing port would be classified as security by obscurity. I.e. Security wise it makes no difference. A bot will port scan you anyway.

What setting you need to do on your router. Unsure. Never had to tweak this on any of mine.
I would say that the router should be able to find the lookup address in its own dns table.

I.e. It knows resolves the duckdns address to its own external address. And hence loops it back internally.

So should not be any nat-loopback involved.

February 2019

Alex_Yeoman

my duck dns works outside my local network - https://XXXXXX.duckdns.org/....but When I use the same address at home on the local network it brings up the login page for my router not home assistant. What I’m I missing? Any help would be greatly appreciated? Thanks!

1 reply
February 2019 ▶ Alex_Yeoman

DavidFW1960

You haven’t forwarded 443 to 8123

1 reply
February 2019 ▶ DavidFW1960

Alex_Yeoman

I do have 443 to 8123 setup. I have a Ubuquiti edgerouter…i think this may be the issue.

I thought this might help but it didn’t…https://loganmarchione.com/2017/04/duckdns-on-edgerouter/

1 reply
February 2019 ▶ Alex_Yeoman

Alex_Yeoman

figured it out…I removed the lan interfaces from the port forwarding and put switch0

February 2019

vvanderhammen

Hi All
Can you help please Installed Hass.io couple of days ago, now setting up DuckDNS as distributed.
The Hass does start up anymore this is my error message in the log file:

2019-02-26 11:11:09 ERROR (MainThread) [homeassistant.core] Error doing job: SSL error errno:1 reason: HTTP_REQUEST
Traceback (most recent call last):
File “uvloop/sslproto.pyx”, line 504, in uvloop.loop.SSLProtocol.data_received
File “uvloop/sslproto.pyx”, line 204, in uvloop.loop._SSLPipe.feed_ssldata
File “uvloop/sslproto.pyx”, line 171, in uvloop.loop._SSLPipe.feed_ssldata
File “/usr/local/lib/python3.7/ssl.py”, line 763, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: HTTP_REQUEST] http request (_ssl.c:1056)

this is in my configurations file:
http:
# base_url: https://secret.duckdns.org:8123
# ssl_certificate: /ssl/fullchain.pem
# ssl_key: /ssl/privkey.pem

and this is the setup in the DuckDNS setup:
{
“lets_encrypt”: {
“accept_terms”: true,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
},
“token”: “token from Duck DNS page”,
“domains”: [
“secret”
],
“seconds”: 300
}

I did not install the add-on Letsencrypt separately, as it was not in the instruction.

Anybody any idea to help the newbe with HASS

Greetings
Valentijn

1 reply
February 2019 ▶ vvanderhammen

vvanderhammen

I could startup Hass with the following in my config file.

# duckdns  
http:
#  base_url: https://secret.duckdns.org:8123
#  ssl_certificate: /ssl/fullchain.pem
#  ssl_key: /ssl/privkey.pem

but no ssl…

1 reply
February 2019 ▶ vvanderhammen

Vennerberg

Remove https:// and remove port
Remove /ssl/

1 reply
February 2019 ▶ Vennerberg

vvanderhammen

@Vennerberg thanks for the remark. tried that but without succes.

Config file error:
Invalid config for [http]: not a file for dictionary value @ data['http']['ssl_certificate']. Got 'fullchain.pem'
not a file for dictionary value @ data['http']['ssl_key']. Got 'privkey.pem'. (See /config/configuration.yaml, line 44). Please check the docs at https://home-assistant.io/components/http/ 

any other ideas?

February 2019

Vennerberg

Wait hold on… in configuration.yaml it’s supposed to be as you stated. With https:// and /ssl/ In the hassio config for duckdns it’s supposed to be as I said. No https, no ports and no /ssl/

And remove #

February 2019

Vennerberg

@vvanderhammen
Did it work?

1 reply
February 2019 ▶ Vennerberg

vvanderhammen

Nope sorry, this is what I have tested:

config Duckdns:
{
“lets_encrypt”: {
“accept_terms”: true,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
},
“token”: “token from Duck DNS page”,
“domains”: [
secret.duckdns.org
],
“seconds”: 300
}

So without the /ssl/ ports and https

And my config file is
this is in my configurations file:
http:
base_url: https://secret.duckdns.org:8123
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

same error log I’m afraid… :frowning:

February 2019

Vennerberg

Have you open the required ports on the router, 80, 443 and so on?

1 reply
February 2019 ▶ Vennerberg

vvanderhammen

Yes I Did the following

external port 80 to internal port 8123
external port 443 to internal port 8123
external port 8123 to internal port 8123

Which in my opinion should be oké. :slight_smile: but I could be wrong… :slight_smile:

2 replies
February 2019 ▶ vvanderhammen

Vennerberg

I’ll check my ports when i get home.

February 2019 ▶ vvanderhammen

DavidFW1960

80-8123?? Why? 80-80 is generally needed for LetsEncrypt

1 reply
February 2019 ▶ DavidFW1960

vvanderhammen

@DavidFW1960
Because the DuckDNS ad-on now support the LetsIncrypt. And as it uses that “ad-on” / addition also, my reasoning was to also open that port.

@Vennerberg
thanks for your help! :slight_smile:

1 reply
February 2019 ▶ vvanderhammen

DavidFW1960

If you’re using the Hassio duckdns addon, you don’t need 80 forwarded at all…

February 2019

Vennerberg

nono,
Forward external 80 to internal 80 (TCP)
Forward external 443 to internal 443 (TCP)
(You might have to remove 8123 to 8123)

Start duckdns addon.

After this, forward 443 to 8123. Remove 443 to 443

Do as the video.

- YouTube

2 replies
February 2019 ▶ Vennerberg

vvanderhammen

Thanks, will try this tonight, from the office is it bit tricky to forward ports at home and restarting plugins. Will let you know what the result was.

1 reply
February 2019 ▶ vvanderhammen

DavidFW1960

The duckdns addon doesn’t require port 80 regardless of any video.

February 2019 ▶ Vennerberg

Paul_Flavel

@Vennerberg
You only need to fwd port 8123. No need to do the other ports. Unless my setup was exempt.
I only have port 8123 forwarded with no issues.

1 reply
February 2019 ▶ Paul_Flavel

Vennerberg

If you say so great, but isnt the renewal of certificates done through port 80?
If not, then i’ll close the ports when i come home.

1 reply
February 2019

Paul_Flavel

Well I only have port 8123 forwarded and everything including renewals is working just fine.

February 2019 ▶ Vennerberg

DavidFW1960

With the duckdns addon it uses the DNS validation instead of HTTP - that is why it doesn’t require port 80.

Regarding other forwards… if you forward port 8123 to 8123 then you always need to specify the :8123 at the end of the HA URL. If you forward 443 to 8123 then you don’t need to specify any port.

1 reply
March 2019 ▶ DavidFW1960

shawtux

Hi!
@DavidFW1960 seems like you know about the config.

I have a working duckdns. I generated no problem the SSL.

I did a port forwarding from external 8123 to interal 8123 with the pi internal ip.

Checked that the ip in duckdns was correct with another tool (what is my ip) and it matches up.

I added in my configuration.yaml the following:

http:
  base_url: https://specialurl.duckdns.com:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

(obviously specialurl is not the real section)

still i get " This site can’t be reached" when i enter in the browser https://specialurl.duckdns.com:8123

any ideas?

1 reply
March 2019 ▶ shawtux

DavidFW1960

assuming your indenting is correct, you can try removing the /ssl from the cert and key…

March 2019

shawtux

updated to the correct format.

if i do what you ask in the configuration.yaml file i get the following:

Configuration invalid
Invalid config for [http]: not a file for dictionary value @ data['http']['ssl_certificate']. Got 'fullchain.pem'
not a file for dictionary value @ data['http']['ssl_key']. Got 'privkey.pem'. (See /config/configuration.yaml, line 23). Please check the docs at https://home-assistant.io/components/http/
1 reply
March 2019 ▶ shawtux

DavidFW1960

keep the leading / so /privkey.pem etc

2 replies
March 2019 ▶ DavidFW1960

shawtux

had to uninstall and reinstall duckdns addon.
the /ssl/ folder was empty so it had to recreate the files. that was the error.

back to square 1 that the url didnt work.

March 2019 ▶ DavidFW1960

shawtux

for the record:
my network consists of a cablemodem with routing capabilities and a router. I thought i had disabled the routing capabilities, but that was not so.

fixed!

April 2019

andrew1

If i have a wireless hub attached to a google fiber modem, do i need to port forward on both of them?

1 reply
April 2019 ▶ andrew1

DavidFW1960

You only portforward on the router

April 2019

andrew1

that’s what i was missing. in my previous attempts I only enabled port forwarding on the attached wireless hub. now that i’ve enabled it on the router the duckdns URL communicates with my home assistant. thnx!

May 2019

bcarter

Is anyone able and willing to help me troubleshoot my setup? I am NOT using duckdns, and I am NOT using hass.io.

I have a domain and successfully generated certs from letsencrypt, no matter what I add to my configuration.yaml file… I get the following error in the log

2019-05-03 12:32:25 ERROR (MainThread) [homeassistant.config] Invalid config for [http]: not a file for dictionary value @ data['http']['ssl_certificate']. Got 'ssl/fullchain.pem'
not a file for dictionary value @ data['http']['ssl_key']. Got 'ssl/privkey.pem'. (See /config/configuration.yaml, line 23). Please check the docs at https://home-assistant.io/components/http/

what I have tried:
different directories and different permissions for the cert files, including 777 wide open
different port forwarding rules, though this does not matter as these errors are on start up, and not when connecting.
adding and removing a bunch of different compinations of leading “/” and “” and ‘’ to see… the error has always been the same

Thanks for any help!

May 2019

bcarter

hello all… I have fixed it!

my issue was a docker issue… and so I was not actually placing the certs where I thought I was. I changed

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  base_url: mysubdomain.no-ip.biz:8123

to:

http:
  ssl_certificate: /config/ssl/fullchain.pem
  ssl_key: /config/ssl/privkey.pem
  base_url: mysubdomain.no-ip.biz:8123

because within my docker install the config folder is not where the homeassistant root folder is, and so there was no <>/ssl/ folder, nor a /ssl/ folder in the docker install. so I had to fully qualify the proper location, and everything worked perfect.

1 reply
May 2019

Chinedu_Abia

Interesting! I’ll try it.

May 2019 ▶ petermj

rattatosk

Hi Petermj,
Did you ever got this fixed for the ios app. I currently have the same issues.

Works perfectly trough webbrowser externally, but the HA ios app fails :
An SSL error has occured and a secure connection to the server cannot be made.
I setup an duckdns address.

2 replies
May 2019 ▶ rattatosk

petermj

Hi, I never tried again :roll_eyes:

I should give a try again sometime, but have no time right now. For now I have installed the HomeKit plugin and can control all my devices using the Home app on my iPhone, which I believe is secure.

May 2019 ▶ rattatosk

b.maia81

Exactly the same problem here.
I got Duckdns + caddy and works perfectly in internal network as well as externally by browser (even safari on iphone). But with the IOS app (2.0) fail with the same SSL error.
Already posted on IOS but no support so far. I guess the app cannot handle this configuration.

May 2019

LunchBox

Greeting everyone,

I just noticed this thread and have a question.

I have HassIO setup with DucksDNS and LetsEncrypt.

My question is.
The main comment on the steps described in thr beginning of the thread state that we do not need to open any ports.

This means that it’s not needed for the user to open any ports!

However, I see many responses that say you still need to open and forward a port.

Can someone please clarify?.

I was able to access HA from outside and after closing the port I can’t access HA from outside.

Thank you

Walter

1 reply
May 2019

DavidFW1960

They will be referring to opening ports for LetsEncrypt validation which is not needed if you use the DuckDNS addon for Hass.io as it uses DNS validation instead of http validation.

You DO still need to forward say port 443 to 8123 to access home assistant from outside your network though. Before I used IPv6 I used a port in the high 30000’s range instead of forwarding port 443. You would then access by https://domain.duckdns.org:port

1 reply
May 2019 ▶ DavidFW1960

LunchBox

David,

LOL. okay that is what I figured but I thought that maybe there was some magic going on that I didn’t understand.

Okay, back to opening the port (which I really don’t like). Since I recently re-build my HA, I will go back to installing NGINX.

Thank you

1 reply
May 2019

DavidFW1960

Yeah you and almost everyone else. You can use Nabu Casa the HA cloud with no open ports, or use zero tier one (which works really well) with no PF but other than that, if you want external access then you need to open/forward a port.

On my system I use only IPv6 (my duckdns address only has a IPv6 address updated) and I then have to open 443 (no PF) which is more obscure at the least…

June 2019 ▶ bcarter

mr_white

Hallo bcarter

can you tell me what is your duckdns add-on configuration? did you also use the /config/ssl/ path there?
I tried that and is NOT working for me.

thanks in advance

1 reply
June 2019 ▶ mr_white

bcarter

hello @mr_white ,

I did not use duckdns for two reasons… I did not install HASS.io and so add-ons are not trival for me to get up and running, and I also have a DDNS provided by noip.com.

What is your set up and I can try to help.

1 reply
June 2019

mr_white

Hallo!

please have a look here:

don´t want to double post.

EDIT: this is the configuration error i get when i am adding the ssl file path in the configuration.yaml:

Invalid config for [http]: not a file for dictionary value @ data[‘http’][‘ssl_certificate’]. Got ‘/ssl/fullchain.pem’
not a file for dictionary value @ data[‘http’][‘ssl_key’]. Got ‘/ssl/privkey.pem’. (See /config/configuration.yaml, line 55). Please check the docs at HTTP - Home Assistant

thanks in advance

July 2019

truxntrax

Everything is working great for me using this guide:

https://www.splitbrain.org/blog/2017-08/10-homeassistant_duckdns_letsencrypt

What I would like to do now is allow SSL access to my other services on the same folder: Transmission (port 9091), zoneminder - (port80). I note that @chrisw has used this to enable other things (Emby).

Do I “just” need to reference these cert and key files in apache2 or do I need to make changes to hool.sh also?

Many thanks if anyone has a minute to explain how I can use this as described!

Trux

July 2019

trob76

so I was using duckdns with letsencrypt after several attempts using this

{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "my generated token",
  "domains": [
    "xxxxxxxx.duckdns.org "
  ],
  "seconds": 300
}

I kept getting this error

ERROR: An error occurred while sending post-request to https://acme-v02.api.letsencrypt.org/acme/new-order (Status 400)

and at the bottom of the error

{
  "type": "urn:ietf:params:acme:error:malformed",
  "detail": "Malformed account ID in KeyID header URL: \"https://acme-v02.api.letsencrypt.org/acme/acct/\"",
  "status": 400
}

I eventually just installed letsencrypt manually and it worked fine. I don’t know what the issue is, this is a brand new install, so no chance of me really messing something up