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 option for SSL cert algorithm in DuckDNS addon #2189

Merged
merged 5 commits into from
Sep 27, 2021

Conversation

tux2000
Copy link
Contributor

@tux2000 tux2000 commented Sep 21, 2021

  • Add optional parameter lets_encrypt.algo in config.json
  • Use parameter in run.sh as commandline option to dehydrated
  • Update documentation
  • Bump version

Closes #2183

@sstefanowski
Copy link

sstefanowski commented Sep 23, 2021

I vote for this pull request :)
It will also fix problems with Alexa playback of MP3s stored in HA (exposed via HTTPS and played using SSML Audio tag).
Currently, Alexa cannot access MP3 as it cannot make a handshake with HA secured by a certificate generated with the default algorithm.

@ludeeus
Hi, Could you please consider the approval of this pull request?
I checked the commit history... and it looks like in July you have committed the change including an upgrade of the dehydrated version from 0.6.5 to 0.7.0.
Dehydrated 0.6.5 used rsa as the default "certificate algorithm". Dehydrated 0.7.0 uses secp384r1.
Since that time some HA clients (also important like Amazon Alexa SSML engine) cannot do the HTTPS handshake. It can be successful if a certificate could be generated using another algorithm (e.g. rsa)

duckdns/data/run.sh Outdated Show resolved Hide resolved
duckdns/config.json Show resolved Hide resolved
duckdns/DOCS.md Outdated Show resolved Hide resolved
duckdns/config.json Outdated Show resolved Hide resolved
duckdns/config.json Outdated Show resolved Hide resolved
duckdns/data/run.sh Outdated Show resolved Hide resolved
@pvizeli pvizeli merged commit fb3919f into home-assistant:master Sep 27, 2021
@teknomar7
Copy link

The "algo" parameter does not appear to be optional as indicated in the documentation. When I updated this morning, duckdns would not start back up without defining an algo k/v.

This was seen in the logs prior to defining the k/v in the configuration (token and dns names have been redacted):

21-09-27 08:30:30 ERROR (MainThread) [supervisor.addons.addon] Add-on core_duckdns has invalid options: Missing option 'algo' in lets_encrypt in Duck DNS (core_duckdns). Got {'lets_encrypt': {'accept_terms': True, 'certfile': 'fullchain.pem', 'keyfile': 'privkey.pem'}, 'token': '<redacted>', 'domains': ['<redacted>'], 'aliases': [], 'seconds': 300}

@btehan
Copy link

btehan commented Sep 27, 2021

Same as @teknomar7.

@tux2000
Copy link
Contributor Author

tux2000 commented Sep 27, 2021

The changes in dac5764 made the option non-optional.
Not sure what works best, updating the documentation or making the option optional again. I guess forcing all users out there to manually update the configuration will not be optimal...

@teknomar7
Copy link

teknomar7 commented Sep 27, 2021

I would think you'd want to have the default value set if not specified. It lists the default value in the documentation as secp384r1, so it seems like not having a default value was the mistake here (not the incorrect documentation). Furthermore, this wasn't a major version bump, which would imply it's not a breaking change per semantic versioning, when this does break functionality without some type of human interaction.

@tux2000
Copy link
Contributor Author

tux2000 commented Sep 27, 2021

Yes, this was exactly my reasoning when implementing this parameter as optional. Not sure if something with the implementation as it was in b2f282c did not work or what the reason was that @pvizeli changed the behavior but not the version bump or the documentation prior to merging this to main.

@esenterre
Copy link

Well. I had the problem with the upgrade that "algo" is not optional. I don't care adding line to teh config. But I don't know what (sorry for being dummy :) )

For now, I added :
algo: secp384r1
But should it be
algo: rsa
?

@teknomar7
Copy link

For now, I added :
algo: secp384r1
But should it be
algo: rsa
?

There isn't a right or wrong answer here. I'd go with the default secp384r1, but if you have some client devices that call your https URL that stop working, see if there are any SSL handshake issues in the logs... which might mean you'd need to switch to RSA. The default secp384r1 is ECC and is supposed to improve performance over RSA from my understanding, but might not work on older devices that never got upgraded to work with that encryption type. Most people probably won't notice the difference between any of the options to be honest.

liads pushed a commit to liads/home-assistant-addons that referenced this pull request Jan 12, 2022
* Add option for SSL cert algorithm in DuckDNS addon

* Documentation

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <[email protected]>

* Update CHANGELOG

* Apply suggestions from code review

Co-authored-by: Joakim Sørensen <[email protected]>
Co-authored-by: Pascal Vizeli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DuckDNS add-on generates certificates that are incompatible with Android 7.0
8 participants