-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connection error: invalid peer certificate: Other(OtherError(CaUsedAsEndEntity)) #130
Comments
I think this may be relevant https://users.rust-lang.org/t/error-webpkierror-causedasendentity/48162 |
While I am no expert, my research shows only a third party can issue a CA certificate, thus, it is impossible for self-signed certificate to work without using the --no-strict-ssl parameter then. Am I correct? If so, perhaps If relevant, I did not use the crt directly to the pool. Pool requires pfx which was generated |
No, you can generate it too. The author of the TLS library used in Rigel suggests this: rustls/rustls#124 (comment) I can change the readme to mention that it's the CA certificate that needs to be added to the trust store. |
I understand the frustration. I had to go through this myself a while ago. Unfortunately it's one of rustls' constraints. |
Well technically it is not a rigel issue at all. While your redirect was not a solution for me it pointed me in the right direction and I found this: https://github.com/rustls/rustls/blob/main/test-ca/openssl.cnf Adding those to my openssl.cnf, and creating crt like this So I am very close to solving I think. Will try more after sleep and post solution for others to follow. Will close since issue is not rigel. |
Ok. As a workaround, you can come up with a domain name for your server, say |
Per the rustls test openssl.cnf linked above, alt_names, I just made DNS.1 mirror IP.1 with external ip and used local ip and localhost for the second alt, recreated crt/pfx using same commands listed above. Likewise following your suggestion, under etc/hosts, only 127.0.0.1 was listed so added external ip and local ip to the list. Updated ca-certificates and Trusted Root Certificate Authority and replaced nginx cert/key, restarted nginx and pool.... boom success. I believe the root cause of the issue is an improper understanding/use of openssl.cnf. For people that regularly deal with certs this is probably a walk in the park. For those like myself who are taking it all in for the first time the learning curve is real. I am not quite sure how to simplify such in the readme, but openssl.cnf with SANs is definitely mandatory for success so perhaps a quick reference would save others some time. |
Wanted to simplify this further since my solution above has issues. From here: https://github.com/rustls/rustls/tree/main/test-ca Download build-a-pki.sh, crl-openssl.cnf, openssl.cnf. Edit all 3 to replace desired domain names etc. ./build-a-pki.sh Choose desired algo and enter folder. Install the ca.crt and inter.crt certs to: Create pfx Restart rigel and pool and all should work well. |
Per readme.md:
Using self-signed cert and adding cert to system's trust store in either windows or linux machines I cannot bypass this message unless I use --no-strict-ssl.
Linux, added cert to /usr/local/share/ca-certificates/ then
ran sudo update-ca-certificates
, and verified its addition in following dialogue.Windows,
certutil -addstore -f -enterprise -user root certificate.crt
, and verified addition to Trusted Root Certificate Authority.Crt was created via
openssl req -x509 -sha256 -days 999 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt
Googling the error messages shows rust language in other programs has issues like this but couldn't find solution. Has self signed cert been tested and working without --no-strict-ssl parameter? Steps to reproduce if so please, thanks.
The text was updated successfully, but these errors were encountered: