Would it be possible to add support for Hue Bridge Pro? Getting error in the bridge thing:
Logger Class
org.openhab.binding.hue.internal.handler.Clip2BridgeHandler
Message
initializeAssets() communication error on '192.168.1.31'
Stack Trace
java.io.IOException: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at org.openhab.core.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:266)
at org.openhab.core.io.net.http.HttpUtil.executeUrl(HttpUtil.java:154)
at org.openhab.core.io.net.http.HttpUtil.executeUrl(HttpUtil.java:129)
at org.openhab.binding.hue.internal.connection.Clip2Bridge.isClip2Supported(Clip2Bridge.java:536)
at org.openhab.binding.hue.internal.handler.Clip2BridgeHandler.initializeAssets(Clip2BridgeHandler.java:486)
at org.openhab.binding.hue.internal.handler.Clip2BridgeHandler.initialize(Clip2BridgeHandler.java:467)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:149)
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101)
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732)
at org.openhab.core.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:257)
... 13 more
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(Unknown Source)
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(Unknown Source)
at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source)
at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(Unknown Source)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:654)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:168)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:80)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:131)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:172)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410)
at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
... 1 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at java.base/sun.security.validator.Validator.validate(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
at org.openhab.core.io.net.http.internal.ExtensibleTrustManagerImpl.checkServerTrusted(ExtensibleTrustManagerImpl.java:123)
... 29 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
... 35 more
The URL in FORMAT_URL_CONFIG (eventually http://192.168.1.31/api/0/config) works fine when testing via browser, although it puzzles me why it uses http and not https.
Perhaps just the root cert in Pro bridge is different.
Got it to work, please note that this may be a workaround until proper fix arrives:
Go to https://discovery.meethue.com/, it will list Hue Bridges in your network, copy the idstring and the internalipaddressof your Hue Bridge Pro
Edit /etc/hostsin your OpenHAB box and add new row containing both, first IP address, then ID, e.g. 192.168.1.31 D12345FFFEC4E2D8. This is to work around the SAN requirement, so we need to make bridge URL match with what is defined in the certificate)
Install new Hue root cert (I use Openhabian, so adjust this to your environment): sudo keytool -import -alias hue-root -keystore /etc/ssl/certs/adoptium/cacerts -file hue-root.crt. This is to make Openhab to trust the Bridge certificate.
Restart Openhab
Add Hue Bridge Pro using the Hue Bridge Pro ID as the IP Address (the one you got in step 1, e.g., D12345FFFEC4E2D8)
Not sure why but when I am asked for the password it does not work, but this does: sudo keytool -import -alias hue-root -keystore /etc/ssl/certs/adoptium/cacerts -storepass changeit -file hue-root.crt
In my case the hostname returned using discovery.meethue.com is small caps, while the hue app shows an all caps hostname. (I used the all caps version) and it works!
Note that I used the migration route in the hue app (the Bridge Pro replaced the Bridge). This means I have not needed to make any other changes to openHAB (all light things, channels etc remained the same)
Sorry, misread that you used IP. Did you restart openhab service?
I registered new api key and used that, perhaps you need to do that manually first. I’m not at computer now so cannot give more detailed info how to do it.
Thanks Jussi, highly appreciated - this solved it for me.
For others that may run in to the same issue; obtain the Application Key as described in Get Started - Philips Hue Developer Program before steps 1 to 6 in the guidance above and then add it manually in step 6.