that'd be awesome to have a tutorial with self signed cert! i think most phone can pull certs during auto-provisioning vs manual upload ? then all youd have to do i specify provision urlOh, that changes the story. You can buy a single domain certificate. Your phones should be registered to the same domain. Usually, your main DNS record points to your server. Only if you prefer dual registration in the future, when you have 2 servers, and if your phones support it, then you would need a wildcard certificate. Changing certificates is not hard, but does require a FreeSwitch restart.
Someone recently told me they generate their own Certificate Authority and certificate, and just upload it to the phones as trusted. It works just as well but requires a bit more work in the beginning. I think we are going to see more people leaning towards this way since the commercial certificates now have to be renewed every 7 months. We might even add a tutorial for this to our docs in the future.
care to share ? i have pangolin proxy in front of my fspbx nodes so i pull my LE certs from there so i'd need to modify the script to my env.Yes, it's every 3 months. The script does have an auto-restart for FreeSwitch, will keep you posted if it works and post the code here.
#!/bin/bash
# Called by dehydrated after cert renewal
# Hook: deploy_cert DOMAIN KEYFILE CERTFILE FULLCHAINFILE CHAINFILE TIMESTAMP
deploy_cert() {
local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}"
if [ "$DOMAIN" = "YOUR.DOMAIN.COM" ]; then
echo "Deploying renewed cert to FreeSWITCH..."
cat "$FULLCHAINFILE" > /etc/freeswitch/tls/all.pem
cat "$KEYFILE" >> /etc/freeswitch/tls/all.pem
chown -R www-data:www-data /etc/freeswitch/tls
chmod -R 640 /etc/freeswitch/tls/*
systemctl restart freeswitch
echo "FreeSWITCH restarted with new cert."
fi
}
HANDLER=$1; shift
[ -n "$(type -t $HANDLER)" ] && "$HANDLER" "$@"
0 3 * * * dehydrated -c && systemctl reload nginx