Https not working using DuckDns

Tags: #<Tag:0x00007fc3eb126798>

Dear all

I’m new here and to home assistant. I have a fresh hassio install runing in virtualbox on an ubuntu machine. I have difficulties getting remote access over https to work using the duckdns add-on. I did the following:

Router:
Forward rule:
Outside: port 8123
Type: TCP
Inside: port 8123 to ip of hassio server.

Duckdnd website
Create an free account. Add a domain name:
xxxx.duckdns.org

Install duckdnd add-on with following config:

lets_encrypt:
  accept_terms: true
  certfile: /ssl/fullchain.pem
  keyfile: /ssl/privkey.pem
token: token-from-duckdns-website
domains:
  - xxxx.duckdns. org
aliases: []
seconds: 300

What works:
http:// internal-ip:8123
http:// xxxx.duckdns. org:8123

What doesn’t work:
https:// internal-ip:8123
https:// xxxx.duckdns. org:8123

If I approch these two adresses I get the message that the server returned an invalid response.

From the log files:

Log Details (ERROR)
Logger: aiohttp.server
Source: /usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py:355
Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 275, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

Duckdnas add-on log files give no errors

Any advice on what I’m doing wrong or what I can do to find the problem?

I figure you need to change your configuration.yaml to include those paths too.

Looking at this guide, you need to add:

ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

to your configuration.yaml.

Ignore the base_url as it is no longer required.

Did you forward 433 -> 8123?
Whats in your configuration.yaml regarding http?

When you use https you dont specify the port, just https://xxx.duckdns.org

This won’t matter as HA is only listening in on HTTP and not HTTPS (as per the error) :slight_smile:

Thank you all for your responses.

  • I tried adding the two lines above mentioned by fanuch. This doesn’t result in any change. Does it need http: before it?
  • I did not forward port 443 to 8123 as it is in use by another webserver.
  • how do I make home assistant listen to https?

I just set this up on a new installation yesterday and it is mostly as in the guide that is earlier linked to.

The following is what we have in configuration.yaml:

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

The http: you see there is the name of the integration in Home Assistant, like you also have lights, media players etc.

This can be confusing and make you think this might need to be https, but that is not the case. It is underneath this http integration that you configure it by for example setting up ssl_certificate and ssl_key

Hope this helps you

https://myfortressofsolitude.duckdns.org

Defaults to use port 443 (the https default port)
Hence the suggestion above.

This was my guide : -

Thanks for all the tips and help. After following the guide posted by fanuch in the first respons to the letter it is working now.

Hello all

i’m about to give up on all of this. i have been trying to get the remote access to HA in order to get HA geofencing to work and to be controlled from my android app

In duckdns addon have the following:
lets_encrypt:
accept_terms: true
certfile: /ssl/fullchain.pem
keyfile: /ssl/privkey.pem
token: 246*************************************
domains:

and the logs present no errors

On my config.yaml file I have the following:
http:

#use_x_forwarded_for: true
#trusted_proxies:

- 172.30.33.0/24

ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

I do need toi access home assistant from my internal network using https:// .

However when i type in my browser https://arbahomeha.duckdns.org i always get a time out error

and if i insert the same url in my remote connection on my phone it always get an error asking me to review the settings.

The remarked out lines in my config.yaml are there because i was trying to install nginx to no avail

Am doing something incorrectly?

Is the an alternative to duckdns? (i was hopping to give access to my network to my daughter who lives abroad)

furthermore in my automation to leave home the automation should be notifying me on my android phone. If i run the scene in house it works however when i leave i get no notifications.

could this be caused by the same issue? .

PS. I do not know why the IP address here above is in different caps

thank you for responding