-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[hue] Check HTTPS connection (download of PEM certificate) #13617
Conversation
First of all thank you for taking care. I see two issues with your approach. First one is that the certificate is requested/ loaded twice - which is the minor one. Second the constructor of the |
Yes, that is true but that is only at the startup of OH (binding).
I don't see any request started. Here is the code of the called HueBridge contructor: |
Maybe you thought the second constructor was called, the one which also calls |
That being said, I can avoid it. |
It is now fixed. |
I cached the PEM trust manager to not download the certificate twice. |
Fix openhab#13586 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
bundles/org.openhab.binding.hue/src/main/resources/OH-INF/i18n/hue.properties
Outdated
Show resolved
Hide resolved
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@cweitkamp @jlaur : do not hesitate to test it in case you think it cannot work with a V2 bridge. I am confident it will work perfectly ;) |
Already running it. :-)
Exception:
Perhaps it could be reduced to DEBUG? |
OK |
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
So I even fixed a bug I was not aware :) |
Fixed => DEBUG level now used. |
There is a small chance that it will not work. E.g. if the Hue Bridge doesn't have a fixed IP address. But for now I'm happy with it. I already know that there's a but inside the |
So can we merge the PR ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
…3617) * [hue] Check HTTPS connection (download of PEM certificate) Fix openhab#13586 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
ip + ":" + hueBridgeConfig.getPort(), hueBridgeConfig.useSelfSignedCertificate); | ||
|
||
// Check before registering that the PEM certificate can be downloaded | ||
if (tlsTrustManagerProvider.getPEMTrustManager() == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up, will analyze and create issue later: After upgrading to RC1 I kept an eye on my things while booting, and I ended up in this situation. So I will need to analyze exactly how it happened - but it did, and as a result, no further attempts were made to get online and I had to manually restart the binding - after which everything worked fine.
…3617) * [hue] Check HTTPS connection (download of PEM certificate) Fix openhab#13586 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…3617) * [hue] Check HTTPS connection (download of PEM certificate) Fix openhab#13586 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…3617) * [hue] Check HTTPS connection (download of PEM certificate) Fix openhab#13586 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Fix #13586
Signed-off-by: Laurent Garnier lg.hc@free.fr