Skip to content
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

Certificate server down? #535

Open
Dolceady opened this issue Nov 5, 2024 · 0 comments
Open

Certificate server down? #535

Dolceady opened this issue Nov 5, 2024 · 0 comments

Comments

@Dolceady
Copy link

Dolceady commented Nov 5, 2024

Here is my problem, it is stored in the install.sh:

echo "Generating certificat for MAC $mac"
echo -e "\033[33mIf this is a diyhue reinstallation process then you will need to reinstall official Hue apps from PC and phone in order to wipe old certificate.\033[0m"
serial="${mac:0:2}${mac:3:2}${mac:6:2}fffe${mac:9:2}${mac:12:2}${mac:15:2}"
dec_serial=python3 -c "print(int(\"$serial\", 16))"
faketime '2017-01-01 00:00:00' openssl req -new -config openssl.conf -nodes -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -pkeyopt ec_param_enc:named_curve -subj "/C=NL/O=Philips Hue/CN=$serial" -keyout private.key -out public.crt -set_serial $dec_serial -days 7670
if [ $? -ne 0 ] ; then
echo -e "\033[31m ERROR!! Local certificate generation failed! Attempting remote server generation\033[0m"
### test is server for certificate generation is reachable
if ! nc -z mariusmotea.go.ro 9002 2>/dev/null; then
echo -e "\033[31m ERROR!! Certificate generation service is down. Please try again later.\033[0m"
exit 1
fi
curl "http://mariusmotea.go.ro:9002/gencert?mac=$mac" > /opt/hue-emulator/cert.pem
else
touch /opt/hue-emulator/cert.pem
cat private.key > /opt/hue-emulator/cert.pem
cat public.crt >> /opt/hue-emulator/cert.pem
rm private.key public.crt
fi

if [ ! -d "/opt/hue-emulator/config/" ]; then
mkdir /opt/hue-emulator/config/ -p
fi
cp /opt/hue-emulator/cert.pem /opt/hue-emulator/config/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant