-
Notifications
You must be signed in to change notification settings - Fork 70
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
SSL certificate --insecure option does not work #184
Comments
Yes please PRs and tests very Welcome over manual fixed :) Thank you! |
@milanvo i unfortunately don't recall the exact sequence of events. I believe I at least did test it at the initial implementation. i might not have tested insecure certificates after the last change where I moved to use session to make sharing of settings easier. if we could somehow find a way to test this in isolation when running unittests it would be awesome so we don't miss it again ;) |
Found this upstream issue https://github.com/kennethreitz/requests/issues/4938 I see these options:
What do you prefer @maxandersen ? 😉 Unit tests to reliable test SSL non-validation - it is question. It can be tested against |
Nice digging. Yeah seems that upstream bug was closed immaturely. Probably by a script not a human :/ I'm fine going back to passing the parts that doesn't work in directly especially since we need to do that for websocket APIs anyway. Moving everything to websocket APIs might be where we end up eventually but that would be a much bigger change and for some operations the rest API is a bit nicer to work with so I would say fix the cert issues first - especially since it seems like a simple fix. And oh boy thanks for letting me know about badssl - that's awesome and much simpler than my own past attempts on making a test xobtsiner! Go ahead and make tests that uses the site, if too slow we'll just tag them and it Will be skipped in regular test runs and only fully run on ci. Not at laptop so can't find the exact tag but don't worry about that - that's an easy fix when you have the pr in. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@milanvo still interested contributing this? |
Hi, I am sorry, we have another project now - baby on the way. |
Congratulations :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Got the upstream bug re-opened. The corresponding PR was/is psf/requests#4935 Edit: Note the latest comment on the PR. I.e., an actual fix while avoiding duplicate and potentially confusing code would require more work. I.e. some reconciliation must come to Edit: New PR and new approach: |
Thanks for digging. No wonder I couldnt get it to work then :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is quite annoying... is there anything that can be done to fix this without depending on the upstream issue ? |
Just came back to this again, and found this comment: #66 (comment) The gist is: use the REQUESTS_CA_BUNDLE env var to point to your ca.pem file (I guess you have to setup tls with a CA proeprly, that has many benefits so I would recommend it) |
Hi,
This is great tool for CLI access to HA ❤️
HA version: 0.87.1
CLI version: current dev (c4889fa)
Issue
I have issue connecting to Home Assistant with HTTPS and self-signed certificate. It looks like disabled verification at session level is ignored.
I make it work by workaround - change this for HTTP GET https://github.com/home-assistant/home-assistant-cli/blob/c4889faa7d0a9a5c1a9f06e52d9e8587c44e1d93/homeassistant_cli/remote.py#L77
to this:
or with path to server cert:
For WebSockets, it is probably not implemented yet, but this also works - changed this https://github.com/home-assistant/home-assistant-cli/blob/c4889faa7d0a9a5c1a9f06e52d9e8587c44e1d93/homeassistant_cli/remote.py#L107
to:
I can make PR if needed or test code change etc. Thanks
The text was updated successfully, but these errors were encountered: