What's new

Custom Certificates Upload?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

tdhite

Occasional Visitor
Searched extensively for info on cert uploads. Admittedly not scoured the code quite yet, but also I'm not able to get upload certs to work. Unit is RT68U, generally works well.

With that said, anyone have success on custom certificates upload? I have a particular need, so (at least for the moment) can't live with LE's specific certs or the generated ones.

Thanks for any pointers.
 
Which '68U exactly? Which firmware is installed?
 
Finally scoured sources -- seems mssl_cert_key_match is surely failing. Alas, no way to know without a fresh build of entire ROM due to stub-out of logging in mssl.c:

@RMerlin -- happy to PR a reasonably efficient debug print; this is a low frequency function set (i.e., mssl_* functions should not get called often). Observability in the area would be very helpful to many, I'd think. Don't want to push a PR if you'd not accept for some reason -- is there one?

Thanks for any comments.
 
Finally scoured sources -- seems mssl_cert_key_match is surely failing. Alas, no way to know without a fresh build of entire ROM due to stub-out of logging in mssl.c:

@RMerlin -- happy to PR a reasonably efficient debug print; this is a low frequency function set (i.e., mssl_* functions should not get called often). Observability in the area would be very helpful to many, I'd think. Don't want to push a PR if you'd not accept for some reason -- is there one?

Thanks for any comments.
What is the exact issue? I upload my own certificate to 7-8 different development routers here, without any problem.
 
What is the exact issue? I upload my own certificate to 7-8 different development routers here, without any problem.
The exact issue is regardless of upload, autogenerated certs are forced. Because the key/cert pair are in /etc/key.pem and /etc/cert.pem (even if I manually place with appropriate script), httpd forces regeneration.

So the likelihood is one of:

1) certs are not in a pem form the system can swallow; or
2) cert form is somehow not supported (though they are just standard LE certs with other SANs involved that work fine on other platforms, namely certian vcenter/esxi hosts I have involved).

Given the code in httpd.c (though no logs available in mssl.c); pretty sure mssl_cert_key_match is returning failed cert check (repeating, because both pem files are properly in /etc).
 
looking further, pretty sure the modulus check is the issue. i'm using EC private keys and looks like only specifically matched RSA/RSA or DSA/DSA key/cert pairs are allowed. Can't be certain, sure looks like it.

This begs for documentation and some observability to problems, imho. This is code we can control given it's visible. Let me know, as mentioned, happy to push a PR.
 
i'm using EC private keys and looks like only specifically matched RSA/RSA or DSA/DSA key/cert pairs are allowed. Can't be certain, sure looks like it.

That would be the most likely reason, as I have no problem with multiple routers using my own certificates (I manage a CA for my internal devices). EC were never officially supported either by Asus or myself.

If you want to do a PR to add EC validation to mssl, go ahead. I`ll review it and merge it in. I've had users report that EC certificates used to work in the past, so I suspect they stopped working after Asus added the validation to mssl.
 
Im using dehydrated for signing certificates and the default key was ECC secp384r1

HTTPD was always generating new SSL certificates

Adding the option KEY_ALGO=rsa solved the problem

HTTPD mssl_cert_key_match : PASS

RT-AC86U 386.3
 
Hi
That would be the most likely reason, as I have no problem with multiple routers using my own certificates (I manage a CA for my internal devices). EC were never officially supported either by Asus or myself.

If you want to do a PR to add EC validation to mssl, go ahead. I`ll review it and merge it in. I've had users report that EC certificates used to work in the past, so I suspect they stopped working after Asus added the validation to mssl.

Hi. I've prepared a PR to validate EC certificates in mssl_cert_key_match(). https://github.com/RMerl/asuswrt-merlin.ng/pull/824
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top