Not able to connect to Mongodb vie mongo shell
I suspect Compass is falling back on the system trust store while the command line tool is not.
Capture the certificate presented by the server:
openssl s_client -connect some-url:27020 &lt;/dev/null &gt; retrieved_cert.pem

And then validate using the CA certificate:
openssl verify -CAfile CA_INTERMEDIATE retrieved_cert.pem

If validation succeeds, you should see
retrieved_cert.pem: OK

If that doesn't work, take a look at the subject and issuer of each certificate, and ensure that the file passed to --tlsCAFile contains the self-signed root certificate at the head of the chain.