Community discussions

MikroTik App
 
ColinSlater
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Sep 12, 2021 2:32 pm

Let's Encrypt - only 1 certificate allowed?

Sat Dec 24, 2022 10:24 am

Good morning Mikrotik Community,

Quick question - is it only possible / allowed to install 1 Let's Encrypt certificate on the mikrotik at a time?
Just tried to install a second one using the enable-ssl-certificate dns-name=xxx command and it went through the process, but at the end said "certificate updated" and only the original certificate remained untouched.

Thanks

Colin
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Let's Encrypt - only 1 certificate allowed?

Sat Dec 24, 2022 10:32 am

Nice question,
but probably is Let's Encrypt limit, if I do not remember bad, to 6 cert/month or similar.
If you do some test, the counter decrease, if you exaust the limit, nothing is done.
 
Sob
Forum Guru
Forum Guru
Posts: 9120
Joined: Mon Apr 20, 2009 9:11 pm

Re: Let's Encrypt - only 1 certificate allowed?

Sat Dec 24, 2022 1:30 pm

No, it's RouterOS. The whole thing is basically like an early alpha version that leaked out prematurely. It's fine as techdemo, but not actually usable yet. You can get one certificate, it works, and that's it. It doesn't even renew, at least not automatically.

You can't request another one (for different hostname), to have one e.g. for WebFig and another for SSTP, even though it's not any far fetched idea.

Changing hostname doesn't seem to work either. I had router with one expired certificate for <hostname1> and tried "/certificate/enable-ssl-certificate dns-name=<hostname2>". It seemed to complete successfully, but certificate list still shows only old expired certificate for <hostname1>. When exported, it's valid new certificate for <hostname2>, so it looks like display error in RouterOS. But it's something more, because WebFig doesn't work with it either.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Let's Encrypt - only 1 certificate allowed?

Sat Dec 24, 2022 1:34 pm

Image
 
ColinSlater
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Sep 12, 2021 2:32 pm

Re: Let's Encrypt - only 1 certificate allowed?

Sat Mar 04, 2023 4:07 pm

Anyone got any ideas if the new v7.8 addresses this issue?
I couldn't see any mention of this in the release notes.

Thanks

Colin
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3422
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Let's Encrypt - only 1 certificate allowed?

Sat Mar 04, 2023 4:26 pm

One certificate, many names. You should be able to add multiple DNS names in the dns-name= field (e.g.
/certificate enable-ssl-certificate dns-name=www.example.com,myrouter.example.com  
As long as they are "valid" (e.g. LE can reach RouterOS by ALL of them), that should work. But if one doesn't complete validation, the entire request fails.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3422
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Let's Encrypt - only 1 certificate allowed?

Sat Mar 04, 2023 5:38 pm

To be clear, this is an accurate description:
No, it's RouterOS. The whole thing is basically like an early alpha version that leaked out prematurely. It's fine as techdemo, but not actually usable yet. You can get one certificate, it works, and that's it. It doesn't even renew, at least not automatically.
Since one never know if things change, I just tested the on V7.8 with an expired cert. But everything here is manual. Since these things expire after 90 days, some practice here. I remove manually any old LE certs to be sure. And after the updating the cert, the internal web server doesn't always seems to use it right away, so you have to toggle the /ip/service of https and/or reboot in my experience after it updates the certificate. But the dns-names with multiple does produce the "2.5.29.17" with all of them in the LE certs. And you can see the /certificate/enable-ssl-certificate go through the validation step for EACH domain name in the CLI.

That being said, to @Sob point... When I care about TLS working publicly, I just pay for a wildcard one to get a longer expiration. But LE be fine in these cases – IF only just renewed automatically (and used DNS validation to avoid port 80). It is quite annoying. But the multiple names problem I ran into early, I like service-based DNS names (e.g. webfig.<fqdn>, sstp.<fqdn>, etc) – even only one router today, unwinding client to split these things up later is annoying.
 
Sob
Forum Guru
Forum Guru
Posts: 9120
Joined: Mon Apr 20, 2009 9:11 pm

Re: Let's Encrypt - only 1 certificate allowed?

Sat Mar 04, 2023 9:35 pm

I like LE for the automation alone. Being free is nice bonus. Paid certificates always required some annoying manual work. It wasn't too bad when they had very long validity (I don't know what was the maximum, but I used to have some five-year ones), but now we're down to one year. And if it goes even lower (some want it to), LE will be clear winner, except in places where there's really no chance to automate things.

I believe that RouterOS will do the right thing eventually. Working automatic renewals, DNS validation, or anything else one might need. It's not like any of that should be too difficult once the main part is done.

DNS validation with custom domains would require external DNS server, but it's pretty easy for people who need it. And for xxx.sn.mynetname.net it could be done by MikroTik, if they wanted to, then RouterOS could get certificates without exposing any service to internet. It could confuse some people who would think that incoming connection would work even if they don't public address (they of course wouldn't), but it would be useful when you do have some incoming ports, just not 80.
 
ColinSlater
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Sun Sep 12, 2021 2:32 pm

Re: Let's Encrypt - only 1 certificate allowed?

Sat Mar 11, 2023 9:23 am

Hi Guys,
Thanks for the replies here.
To answer the point about automatic renewal, I already encountered this problem and got around it with a script (as you'll see in the post, it's a modified version of something someone else had written)
viewtopic.php?t=189289

I'll have a play with the multiple DNS Names thing though.

Thanks

Colin
 
suidroot
just joined
Posts: 1
Joined: Wed Nov 01, 2023 8:16 pm

Re: Let's Encrypt - only 1 certificate allowed?

Wed Nov 01, 2023 8:28 pm

Hi,
/certificate enable-ssl-certificate dns-name=www.example.com,myrouter.example.com  
I've been using this approach to create a LE cert with multiple dns alt names for quite a while but not it does not work any more.
It tries to lookup the list as one hostname and fails:
[admin@MikroTik] /certificate> enable-ssl-certificate dns-name=mikrotik.mydomain.net,mikrotik.some.otherdomain.net
  progress: [error] could not resolve 'mikrotik.mydomain.net,mikrotik.some.otherdomain.net'
Current Firmware 7.11.2

Any ideas?

Thanks!
Suid

Who is online

Users browsing this forum: globalmedia and 36 guests