Page 1 of 1

DoH certificate handshake failed (Quad9)

Posted: Thu Jul 25, 2024 6:57 pm
by alphalt
Hi,

Today, all of the sudden, without doing any changes to Mikrotik, I lost internet connection. After some investigation I've found this fault message:
DoH server connection error: SSL: handshake failed: unable to get local issuer certificate (6)
I know that there are tons of forum entries about this topic. I just wanted to ask if there is somebody else using QUAD9 DoH servers and can confirm that problem exists. I do not know whether it is problem at Mikrotik side (I doubt as I did not make any changes nor updates) or something is really wrong with Quad9 certificates.

The only way to workaround this issues is to remove tick mark from Verify DoH Certificate. Then it works. For safety reasons I went back to ISP DNS servers until I find out what is going on.

Would appreciate any help or ideas what to check.

Regards

Re: DoH certificate handshake failed (Quad9)

Posted: Thu Jul 25, 2024 7:10 pm
by erlinden
If you want to check "Verify DoH Certificate" (which you obviously do), you hwave to make sure the MikroTik has the Root CA installed.

Check this blog that explains the steps to get it to work:
https://www.shellhacks.com/mikrotik-dns ... loudflare/

Re: DoH certificate handshake failed (Quad9)

Posted: Thu Jul 25, 2024 7:25 pm
by alphalt
Thanks for reply.

As I said, everything was working without any issues until today, this is not new setup. It was fully working setup until it stopped all of the sudden today. And yes, I have already had Root CA certificate, but it was a bit different than in the post you mentioned. I was using this one:
https://cacerts.digicert.com/DigiCertGlobalRootCA.crt.pem

Re: DoH certificate handshake failed (Quad9)

Posted: Thu Jul 25, 2024 7:33 pm
by erlinden
Could it be that the imported certificate is expired or renewed?

Re: DoH certificate handshake failed (Quad9)

Posted: Thu Jul 25, 2024 10:37 pm
by alphalt
I thought about that. Certificate is valid until 2031 and I have also downloaded new version in case it was renewed. Still same issue. I have also checked date and time on router and it is ok.

It is strange as it happened all of the sudden. Internet was just gone without doing anything.

If Root CA is used by Mikrotik to validate DoH certificate, could it be problem then on Mikrotik side? Anyone else using this:
DigiCertGlobalRootCA.crt.pem
Do you experience any issues?

Re: DoH certificate handshake failed (Quad9)

Posted: Thu Jul 25, 2024 11:41 pm
by RichNZ
Quad9 have replaced their root. You need the new cert.
https://www.reddit.com/r/Quad9/comments ... ices_must/

Re: DoH certificate handshake failed (Quad9)

Posted: Fri Jul 26, 2024 12:47 am
by macropin
The validation chain changed. DigiCert switched roots, as the CA certificate fingerprints don't match. They're now using "DigiCert Global Root G3". Import DigiCertGlobalRootG3.crt.pem from https://www.digicert.com/kb/digicert-ro ... icates.htm and it will fix the issue.

Re: DoH certificate handshake failed (Quad9)

Posted: Fri Jul 26, 2024 4:44 pm
by alphalt
Thank you for your help, it have resolved my issue.

Funny enough, if I download certificate as it is suggested directly at Quad9 website
/tool/fetch mode=https url="https://cacerts.digicert.com/DigiCertGlobalG3TLSECCSHA3842020CA1-1.crt.pem"
then issue is still there. If I download DigiCertGlobalRootG3.crt.pem direclty from https://www.digicert.com/kb/digicert-ro ... icates.htm as suggested by macropin, then all works like a charm. It is a bit strange that Quad9 guys have link to wrong certificate in their description.

Anyway, it works now. Thanks a lot.

Re: DoH certificate handshake failed (Quad9)

Posted: Fri Oct 11, 2024 7:08 pm
by nacardin
Thank you for your help, it have resolved my issue.

Funny enough, if I download certificate as it is suggested directly at Quad9 website
/tool/fetch mode=https url="https://cacerts.digicert.com/DigiCertGlobalG3TLSECCSHA3842020CA1-1.crt.pem"
then issue is still there. If I download DigiCertGlobalRootG3.crt.pem direclty from https://www.digicert.com/kb/digicert-ro ... icates.htm as suggested by macropin, then all works like a charm. It is a bit strange that Quad9 guys have link to wrong certificate in their description.

Anyway, it works now. Thanks a lot.
Thanks! On RouterOS 7.11.2, DigiCertGlobalRootG3.crt.pem works for me. DigiCertGlobalG3TLSECCSHA3842020CA1-1.crt.pem does not load:
certificates-imported: 0
private-keys-imported: 0
files-imported: 0
decryption-failures: 0
keys-with-no-certificate: 0