I’m using a wildcard Let’s Encrypt cert, and I have a ROS script that imports the chain.pem, cert.pem & privkey.pem files and restarts the www-ssl service setting cert.pem to it.
I just noticed, that one of my python scripts, that uses the requests library is unable to reach the REST API:
Max retries exceeded with url: / (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))
The script worked until recently without any issues.
I started digging and noticed this, the 10.0.0.1 is the mikrotik:
# openssl s_client -connect 10.0.0.1:443 -servername 10.0.0.1 </dev/null | openssl x509 -noout -issuer -subject
depth=0 CN = *.MYDOMAIN.net
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = *.MYDOMAIN.net
verify error:num=21:unable to verify the first certificate
verify return:1
depth=0 CN = *.MYDOMAIN.net
verify return:1
DONE
issuer=C = US, O = Let's Encrypt, CN = R11
subject=CN = *.MYDOMAIN.net
And here’s how it looks for other service that uses the same exact wildcard certificate, I believe it’s runnng nginx under the hood:
# openssl s_client -connect 10.0.0.201:443 -servername 10.0.0.201 </dev/null | openssl x509 -noout -issuer -subject
depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = R11
verify return:1
depth=0 CN = *.MYDOMAIN.net
verify return:1
DONE
issuer=C = US, O = Let's Encrypt, CN = R11
subject=CN = *.MYDOMAIN.net
Notice, that the mikrotik doesn’t appear to serve the whole chain.
This issue affects the following factory-ROS7 devices:
- S53UG+M-5HaxD2HaxD (Chateau 5G ax), running 7.8
- CRS310-8G+2S+, running 7.16.1
- C52iG-5HaxD2HaxD (hap ax2), running 7.13.4
However, I also have the good old hap ac2 (RBD52G-5HacD2HnD) which runs factory-ROS6, (but is upgraded to 7.16.1). It does not present this problem:
# openssl s_client -connect 10.0.0.10:443 -servername 10.0.0.10 </dev/null | openssl x509 -noout -issuer -subject
depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = R11
verify return:1
depth=0 CN = *.MYDOMAIN.net
verify return:1
DONE
issuer=C = US, O = Let's Encrypt, CN = R11
subject=CN = *.MYDOMAIN.net
Following the “REST API Certificate - FullChain.pem?” topic I imported the isrgrootx1.pem & lets-encrypt-r3.pem. I also tried uploading the fullchain.pem from LE and using it on www-ssl but it did not help.
How can I solve this? Why only now did this problem started to appear?