SSL 证书究竟是如何验证的?

How exactly is a SSL certificate validated?

我已经对此进行了一些研究,但在验证签名和根证书方面,关于当服务器将其证书发送给客户端时到底发生了什么,仍然很难将这些点联系起来。

When you create a CSR, it generates a private key along with it

或者您已经生成了自己的私钥。

and you send it to the CA to generate the cert and sign it

您发送 CSR。你不发送你的私钥。这是私人的。您不会将其发送给任何人。

but doesn't the CA use it's own private key to sign?

是的。

So what is the point of the private key you generated with your CSR?

它与证书中包含的 public 密钥配对,它是用于证明您且只有您拥有该证书的过程的一部分,因为只有您可以使用该私钥生成数字签名可以通过证书中的 public 密钥进行验证。

When server sends its certificate for client to validate, how exactly does client validate that it is a valid CA cert. It has a collection of trusted CA certs, ok - but how exactly are they used to verify that it was a valid CA that signed the server's certificate using the signature and public key of the server certificate? What things are compared to make sure it was not forged?

通过验证其数字签名来验证证书本身;检查是否在有效期内;然后尝试使用证书的所谓签名者('issuer')和集合中的受信任证书来形成证书链。

Is there any point in encrypting your internal self signed certs?

没有。它们是 public 个文档。只有私钥是私钥,不在证书中。

How about an internal root cert?

没有

Or is the private key the only one worth encrypting?

是的。

If we don't keep a database of encrypted data for our web service (over SSL) for example, would we ever care about storing our own private key once we generated the self signed cert, and if we do, they why?

因为它是私人的。这是您身份的重要组成部分。如果你泄漏它,其他人可以冒充你。