Not detected in Hue app - Problem with certificate

My diyHue running as a docker install on my Raspberry Pi is detected by HueDynamic but not the Hue app. So following the instructions here https://diyhue.readthedocs.io/en/latest/AddFuncts/debug.html#https-certificate-check

I ran

curl https://127.0.0.1/api/nouser/config -v -k

but that returns

pi@raspberrypi:~ $

  • Expire in 0 ms for 6 (transfer 0x1321880)
  • Trying 127.0.0.1…
  • TCP_NODELAY set
  • Expire in 200 ms for 4 (transfer 0x1321880)
  • connect to 127.0.0.1 port 443 failed: Connection refused
  • Failed to connect to 127.0.0.1 port 443: Connection refused
  • Closing connection 0
    curl: (7) Failed to connect to 127.0.0.1 port 443: Connection refused

Any ideas how I can fix this?

Looks like the ports were not forwarded in docker.

I setup diyhue via docker too. The HUE APP wont connect. The ssl check gives me this error:

root@photon-machine [ ~ ]# curl https://127.0.0.1/api/nouser/config -v -k

  • Trying 127.0.0.1…
  • TCP_NODELAY set
  • Connected to 127.0.0.1 (127.0.0.1) port 443 (#0)
  • ALPN, offering http/1.1
  • Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
  • successfully set certificate verify locations:
  • CAfile: /etc/pki/tls/certs/ca-bundle.crt
    CApath: none
  • TLSv1.2 (OUT), TLS header, Certificate Status (22):
  • TLSv1.2 (OUT), TLS handshake, Client hello (1):
  • OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:443
    curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 127.0.0.1:443

Anyone able to help me with this?

The instructions recommend running in host network mode, so that’s what I did using the command given

docker run -d --name “diyHue” --restart=“always” --network=“host” -e MAC=‘XX:XX:XX:XX:XX:XX’ -v ‘/mnt/hue-emulator/export/’:’/opt/hue-emulator/export/’:‘rw’ diyhue/core:latest

so why would that not work?

I googled forwarding the ports and tried adding -p 443:443 so the command was

docker run -d -p 443:443 --name “diyHue” --restart=“always” --network=“host” -e MAC=‘XX:XX:XX:XX:XX:XX’ -v ‘/mnt/hue-emulator/export/’:’/opt/hue-emulator/export/’:‘rw’ diyhue/core:latest

and I got

WARNING: Published ports are discarded when using host network mode

and when I tried

curl https://127.0.0.1/api/nouser/config -v -k

I still get

  • Expire in 0 ms for 6 (transfer 0x173e880)
  • Trying 127.0.0.1…
  • TCP_NODELAY set
  • Expire in 200 ms for 4 (transfer 0x173e880)
  • connect to 127.0.0.1 port 443 failed: Connection refused
  • Failed to connect to 127.0.0.1 port 443: Connection refused
  • Closing connection 0
    curl: (7) Failed to connect to 127.0.0.1 port 443: Connection refused

Can you send a debug log from diyhue. Just noticed you are using host networking so no need to forward ports.

Try accessing diyhue from http not https.