Hi all,
I’m on RouterOS 7.19.3 (latest stable at time of writing) and have the following issue when trying to create a SSL certificate on my router issuing a request to my local ACME server:
[admin@mikrotik] > /certificate/enable-ssl-certificate directory-url=https://ca.example.com/acme/directory dns-name=mikrotik.example.com
progress: [error] failed to update ssl certificate
On my local freeipa server (that hosts the CA), the endpoints are being hit:
[root@freeipa]$ cat /var/log/pki/pki-tomcat/localhost_access_log.2025-07-14.txt
10.xxx.yyy.12 - - [14/Jul/2025:07:00:59 +0930] "POST /ca/ocsp HTTP/1.1" 200 2662
10.xxx.yyy.1 - - [14/Jul/2025:11:46:55 +0930] "GET /acme/v1/directory HTTP/1.1" 200 430
The following error is identified:
[root@freeipa]$#$ grep -A2 -B10 mikrotik `find /var/log/pki/pki-tomcat -type f`
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: Payload:
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: LDAPDatabase: Searching acmeAuthorizationId=hHsVPfgE99,ou=authorizations,ou=acme,o=ipaca
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: LDAPDatabase: Searching ou=challenges,ou=acme,o=ipaca
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: Valid authorization: hHsVPfgE99
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: Authorization status: pending
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: Challenges:
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: - dns-01: pending
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: - http-01: processing
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [ajp-nio-0:0:0:0:0:0:0:1-8009-exec-1] INFO: Created nonce: {"id":"z_ySz1WuvxECeyghzsEMvA","expires":"2025-07-14T00:04:47+09:30"}
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [Thread-13] INFO: Key authorization: 351B5ERUDcFEoz9OJrD6kg.XhHDv2NBu-NC218YSXi-iy8Kvh0OH5pmDYcCZE1dLe0
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log:2025-07-13 23:34:47 [Thread-13] INFO: Retrieving http://mikrotik.example.com/.well-known/acme-challenge/351B5ERUDcFEoz9OJrD6kg
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [Thread-13] INFO: Response: <h1>404</h1><p>Not found</p>
/var/log/pki/pki-tomcat/acme/debug.2025-07-13.log-2025-07-13 23:34:47 [Thread-13] SEVERE: Invalid response: <h1>404</h1><p>Not found</p>
...
Here, the mikrotik router is not placing the challenge token file in the right location, at least not by the time the query for the well-known token is made by the ACME CA component.
The mikrotik router returns a 404 error, the challenge fails, and the certificate is unable to be issued.
Would anyone know what could be the issue here? Cheers