My FreePBX systems can be accessed by using one of two fully qualified domain names - for example pbx-example-com and pbx5-example-com. My phones register to pbx but when I am building or managing the servers I access it via pbx5. When it is time to build a new server I will build it as pbx6. When I am ready to transition to the new server I move the pbx name to point to pbx6.
I have no problems with getting the certificates using certbot.
First with:
sudo certbot --apache -d pbx7-example-com
(I am a new user, the “-” should be “.”)
And then when I have repointed pbx:
sudo certbot --apache -d pbx.example-com -d pbx7-example-com
I would like to be able to do this using the Certificate Manager in FreePBX but I can’t figure out how to get the Certificate Manager to generate a single certificate for both pbx and pbx5.
One driver in wanting to do this inside FreePBX and Certificate Manager is that I need to use WebRTC and I would prefer to use a single certificate for HTTPS and WebRTC.
I would appreciate any thoughts on how to accomplish the two names in a single certificate using FreePBX and Certificate Manager or any other ways of accomplishing this in a straight forward manner that will not involve manual intervention every time the certificates are renewed.
By the way, I am running FreePBX 16-15 on CentOS 7.
OK, I actually gave him grief about this yesterday. No where in the documentation for this setup did I see a clear mention (or any mention) that FreePBX v15 is 100% BETA which means it still has issues and bugs. Most importantly, it’s not production ready.
However, in your case you are looking to do a multi-domain cert which FreePBX doesn’t support in the Certificate Manager. You’ll have to generate that by hand and follow Let’s Encrypt’s instructions for multi-domain cert generation.
However, if I want to utilize the WebRTC phone in the User Control Panel, I can’t seem to figure out a better way than Certificate Manager > New Certificate > Upload Certificate and uploading the certbot certificate. I am able to enter the certificate I created using certbot, but I am concerned that I might need to repeat this process every 90 days.
I would guess there might be a more elegant solution using linux links or modifying Advanced Settings and Asterisk SIP Settings but I couldn’t seem to hit on a set of settings that worked.
This is not urgent for me to solve as it is a personal PBX, but it would be nice if I could get it working.
Copying the letsencrypt files does seem to work properly.
As a part of the Asterisk import process, the timestamp (but not the file contents) on both pbx.key and pbx.crt is updated.
In addition, as a part of the import process, a third file, pbx.pem is created. This file is a concatenation of pbx.key and pbx.crt, and an identical file can be created by the following commands.
No idea why import locally would not ingest a symlink. But if that is the case manually make the file as you did, then import. Then remake the file as a symlink. Apache doesn’t care.
Yup looks like you will have to work around FreePBX to get what you want. I just tested it out also.
Thankfully, certbot can do all the things for you. I would not change the config directory as @dicko references. Instead, I would leave it in the defualt location (easier to troubleshooot later).
First, generate the cert you want.
Second copy and rename the files.
This will get your cert setup and active for the GUI.
You can then go manage any other pieces such as SRTP and SIP TLS.
When it comes time to renew, you can make a simple script to redo the copy step and then instead of --import, run the --updateall option to have FreePBX regen the combine pem it uses. Then it can restart Apache.
so @dwight you just helped me with something from a couple years ago now.
Since I had the demopbx.domain.com certbot certificate on my PBX, I made it active for apache and changed my desk phone and it worked… So i changed a few other phones and they all worked too.
So, I will now need to schedule taking my system down and actually implementing something like I just described so I can fully use TLS for all the things.
And if needed on new certs (probably a time waster as the certificates are symbolic links to symbolic links so the new certificates will be automatically correct)
fwconsole cert --updateall -q
That leaves your certbot files in a standard place but FreePBX will be happy (even if you use a nonstandard FreePBX place for whatever reason) for other service like fop2 etc. but gets asterisk into a state of happiness also.
A couple of caveats , I did not use the Distro to manage letsencrypt certs at any time just the distributed certbot and apache plugins (but the gooey seems happy with my work) and
hostname -f
properly returns your fqdn, so for the OP, if you have more than one fqdn then rinse and repeat but choose your default appropriately
<Pedantic mode>
Those are not two domains - it is one domain with two host names. Either way, if you aren’t using a “wildcard” cert, the hostnames must match the server they are servicing. If your host has two hostnames, both need certs unless you are using wildcards. </Pedantic mode>
Sorry, that’s been bugging me ever since the thread started.
And to expand on that point, you can easily use a single cert with the SAN containing the other FQDN.
Maybe I should have split my recent replies to a new thread. They are not directly related, other than getting the mechanism of “standard Certbot” to work.