How to check the certificate of the site relative to the local java truststore?

Googled, but did not vyguglil.

Is there no easy way from the command line to providerbut the certificate on the remote site relative to the local truststore.jks?

Using openssl s_client to download the certificate chain from the remote site .pem
but even in this case, everywhere it is written "check your truststore for a ca certificate" any thread keytool -list
That is still hands to compare strings.

I would like a single command (well, two or three, but to get a clear answer true/false) in the shell something like this:

$ supercommand validate remoteserver.com:443 ./truststore.jks

And get a reply like:
"certificate of remoteserver.com issued by XXXX, which is issued by YYY,....
All Issuers in the chain are found in the truststore, the certificate is valid."
March 20th 20 at 11:35
0 answer

Find more questions by tags Command lineDigital certificates