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 support for HTTPS Homeassistant #6

Open
haydonryan opened this issue Jul 15, 2024 · 3 comments
Open

Add support for HTTPS Homeassistant #6

haydonryan opened this issue Jul 15, 2024 · 3 comments

Comments

@haydonryan
Copy link

Thanks for creating this project- very cool! Fits a great usecase especially as homeassistant can send notifications to your phone when the internet is off (makes sending a notification to your phone for things like "the net is down" - super useful)

I was trying to set it up at home, however I have custom certs and have home assistant listening for HTTPS only traffic. Would it be possible to add support for https?

@haydonryan
Copy link
Author

It'd be also awesome to add an option for tls.Config{InsecureSkipVerify: true}

@haydonryan
Copy link
Author

haydonryan commented Jul 15, 2024

I did a quick and dirty test:
added "crypto/tls"

and added a few lines:

78   tr := &http.Transport{
79     TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
80   }
81 
82   client := http.Client{
83     Timeout: time.Duration(5 * time.Second),
84     Transport: tr,
85   }

This worked for me. I would have done a PR but i don't know if this will work with regular HTTP homeassistants, so maybe throw this into your setup and check if it works. Then I'm happy to either let you modify the code or submit a PR. :)

@pinpox
Copy link
Owner

pinpox commented Jul 16, 2024

I personally don't have the time to implement this myself, but would be open to merge any PR's that implement this and don't break the current functionality. If the above works, you should probably expose InsecureSkipVerify: true as an environment variable, similiar to the other settings to make it configurable (and default to false as this is the safer behaviour).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants