0

Having trouble with API calls to Hue. I'm using Retrofit, and calling their v1 API.

I think the problem is "common name validation", from their docs:

"The other part of the certificate validation is checking that the common name on the certificate matches the bridge id of the bridge you are trying to connect to. This is typically done by using the bridge id as hostname and adding a custom resolver that resolves it to the IP address, or by injecting a custom hostname verifier into the HTTPS client which checks that the server principal name matches the bridge id."

I'm not sure what this means; I have the IP address, and the bridge id, but I'm not sure what to do with them?

Adam
  • 1,486
  • 3
  • 20
  • 35
  • What trouble are you encountering? An error? – Jake Lee Jan 02 '22 at 20:25
  • Yes getting this error: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. – Adam Jan 02 '22 at 21:09

1 Answers1

0

You basically want to look up the bridge ID (the device ID, not the one virtually assigned to Signify in the device list response). You can look this up either in the Hue mobile app or when logged into MeetHue via the web.

That ID should be used as your host name, and in the case of Windows, for instance, you can map that ID to the IP address of the bridge in C:\Windows\System32\drivers\etc\hosts. Basically, any way you please to add a manual DNS entry to your environment will do.

starball
  • 20,030
  • 7
  • 43
  • 238