Extending
@bughit's idea, openssl can generate a keypair, the CSR, receive the cert
and CA chain into a PKCS#12 container file, password-protected using a generated password (like Plex's hashing a unique ID for enrolled servers under your account). To start the secure admin web GUI (https server) it would regenerate the password, open the P12 and use the private key and certs within. The hard part is once you have the keypair and CSR, sending it to the CA for signing (again, a PUBLIC CA, as in pre-trusted by FF, Chrome, Edge, Safari, IE, Opera, etc. Most everyone uses the Mozilla CAs, but MS, Google, Apple, and Oracle all have their own pre-trusted CA approval programs), having the CA vet the CSR and issue the certificate, and then getting the certificate back to the router for OpenSSL to put it all back together into the PKCS#12. It's that part that requires an internet connection, and the vetting part of making sure that whoever sent you a certificate for an exposed internet host is in control of that host and its DNS resolving. That's why a custom DNS is going to be needed - to authenticate an exposed internet host, but only to get a certificate that will only be used to authenticate an internal host (the admin service of the router).
It's important to have the router generate and secure its own key. If I give you a key, how do you know I didn't make a copy for myself or someone neither of us is aware of has made their own copy of it?