使用 gnutls 包中的“certtool”,而不是 openssl。
好链条:
$ cat A B C | certtool -e
Certificate[0]: <subject for A>
Issued by: <subject for B>
Verifying against certificate[1].
Verification output: Verified.
Certificate[1]: <subject for B>
Issued by: <subject for C>
Verifying against certificate[2].
Verification output: Verified.
Certificate[2]: <subject for C>
Issued by: <subject for C>
Verification output: Verified.
Chain verification output: Verified.
坏链:
$ cat A B X C | certtool -e
Certificate[0]: <subject for A>
Issued by: <subject for B>
Verifying against certificate[1].
Verification output: Verified.
Certificate[1]: <subject for B>
Issued by: <subject for C>
Verifying against certificate[2].
Error: Issuer's name: <subject for X>
certtool: issuer name does not match the next certificate