简体   繁体   English

自签名证书的情况下,浏览器是否不验证数字签名

[英]Does browser not validate digital signature in case of Self signed certificate

Does my understanding on SSL certificate flow is correct(CA/Self Sign) in below use cases. 在以下用例中,我对SSL证书流程的理解是否正确(CA /自签名)。 Generally when we generate a SSL certificate it has the following contents : 通常,当我们生成SSL证书时,它具有以下内容:

  • Details like owner, domain, validity..etc. 诸如所有者,域,有效性等详细信息。
  • Public Key of the Web Server(Used for Asymmetric key pair SSL handshake) Web服务器的公钥(用于非对称密钥对SSL握手)
  • Digital Signature signed by either CAs Private Key or In case of Self sign, it will be Web Server own Private Key(Hope this understanding is correct?(Q1)) 由CA私钥或“自签名”签名的数字签名将是Web服务器自己的私钥(希望这种理解正确吗?(Q1))

First Web browser gets SSL certificate with its own Public Key. 第一个Web浏览器使用自己的公钥获取SSL证书。 Certificate Validation when CA provider certificate exists: CA提供者证书存在时的证书验证:

  1. Browser will have all Public keys of CAs and hence can validate the Digital signature. 浏览器将拥有CA的所有公钥,因此可以验证数字签名。
  2. Later Public key provided by Web server is used to intiate the symmetric secret key encryption. 以后,Web服务器提供的公共密钥用于启动对称秘密密钥加密。

But blogs also talk about browsers have already Trusted root certificates and it validates. 但是博客还谈到浏览器已经具有受信任的根证书,并且可以进行验证。 Does it mean many a times browser only check certificate content without Digital signature validation(Q2)? 这是否意味着浏览器多次仅检查证书内容而不进行数字签名验证(Q2)?

Now in case of Self-signed, web server would use its own Private key to sign in the Certificate(Istead of CA private Key). 现在,在使用自签名的情况下,Web服务器将使用其自己的私钥来登录证书(而不是CA私钥)。 During first browser interaction, it will send its Certificate along with web servers public Key. 在第一次浏览器交互期间,它将与网络服务器公共密钥一起发送其证书。 So in this scenario, we have the same Public/Private Key pair used both during certificate signing and also to share the symmetric key for data encryption(Q3)?? 因此,在这种情况下,我们在证书签名期间使用了相同的公钥/私钥对,并共享了用于数据加密的对称密钥(Q3)?

Now, blogs say we can import the Certificate manually on browser. 现在,博客说我们可以在浏览器上手动导入证书。 Certificate import would have imported the Public key as well to validate signature correct(Q4)? 证书导入是否也会导入公钥以验证签名正确(Q4)? Blogs say if certificate exists in Trusted Root certificates, it is considered valid. 博客说,如果“受信任的根”证书中存在证书,则认为该证书有效。 Does it mean browser dont do Signature validation(Q5)? 这是否意味着浏览器不执行签名验证(Q5)?

Does anyone help me in understanding Q1 to Q5. 有谁帮助我理解第一季度到第五季度。 Am I missing anything? 我有什么想念的吗?

Your post is hard to follow, but I'll try. 您的帖子很难追踪,但我会尽力的。

Certificates are validated against the issuing Certification Authority (CA), if the CA's root cert is installed in the browser. 如果在浏览器中安装了证书颁发机构(CA)的根证书,则证书将根据颁发的证书颁发机构(CA)进行验证。

For a self-signed certificate, you are the CA. 对于自签名证书, 是CA。

If you create the cert and import the cert for your CA, the certificates you create with it will be trusted. 如果创建证书并为CA导入证书,则使用它创建的证书将受到信任。 If you don't import your CA's cert, your certificate won't be trusted. 如果您不导入CA的证书,那么您的证书将不会被信任。

But blogs also talk about browsers have already Trusted root certificates and it validates. 但是博客还谈到浏览器已经具有受信任的根证书,并且可以进行验证。

The initial set of root certificates for CAs that your browser trusts are installed by the browser's publisher. 您的浏览器信任的CA的初始根证书集由浏览器的发布者安装。 This means that for example, a fresh install of Chrome will trust your bank's SSL certificate that was issued by Verisign, but not your self-signed certificate. 这意味着,例如,全新安装的Chrome将信任您的银行的Verisign颁发的SSL证书,而不是您的自签名证书。

Once you install the root cert from your own CA, your browser will trust your certificates the same as it trusts Verisign's. 从您自己的CA安装根证书后,浏览器将像信任Verisign一样信任您的证书。

As for the question in your title, the browser must validate the signature. 至于标题中的问题,浏览器必须验证签名。 If it doesn't it's broken and this would be a huge security flaw. 如果没有,它就坏了,这将是一个巨大的安全漏洞。

Digital Signature signed by either CAs Private Key or In case of Self sign, it will be Web Server own Private Key(Hope this understanding is correct?(Q1)) 由CA私钥或“自签名”签名的数字签名将是Web服务器自己的私钥(希望这种理解正确吗?(Q1))

Correct. 正确。 The server's certificate will be signed by a CA certificate (either a root CA or more commonly an intermediate CA). 服务器的证书将由CA证书(根CA或更常见的是中间CA)签名。 In case of a self-signed certificate the server's certificate and the CA are the same certificate. 如果是自签名证书,则服务器的证书和CA是相同的证书。

  1. Later Public key provided by Web server is used to initiate the symmetric secret key encryption. 稍后,Web服务器提供的公共密钥用于启动对称秘密密钥加密。

This is only kind true for the RSA key exchange. 这仅适用于RSA密钥交换。 With RSA Kx the pre-master secret is created by the client, encrypted with the public key of the server and send to the server. 使用RSA Kx,可以由客户端创建主密码,并使用服务器的公钥进行加密并将其发送到服务器。 Both client and server then derive all symmetric keys from this pre-master secret. 然后,客户端和服务器都从该主密码之前的秘密中获取所有对称密钥。

RSA key exchange is deprecated though and removed with TLS 1.3. RSA密钥交换已被弃用,并随TLS 1.3一起删除。 Instead Diffie Hellman key exchange should be used. 相反,应使用Diffie Hellman密钥交换。 With DH Kx the servers certificate and the public key inside are only used to authenticate the server in order to protect against man-in-the-middle attacks but are not involved in the key exchange. 使用DH Kx,服务器证书和内部的公钥仅用于认证服务器,以防止中间人攻击,但不参与密钥交换。

But blogs also talk about browsers have already Trusted root certificates and it validates. 但是博客还谈到浏览器已经具有受信任的根证书,并且可以进行验证。 Does it mean many a times browser only check certificate content without Digital signature validation(Q2)? 这是否意味着浏览器多次仅检查证书内容而不进行数字签名验证(Q2)?

The server sends the server (leaf) certificate and possible intermediate certificates and the browser then creates the trust chain from the leaf certificate leading to a local root certificate (trust anchor). 服务器发送服务器(叶)证书和可能的中间证书,然后浏览器从叶证书创建到本地根证书(信任锚)的信任链。 If no such trust chain can be created the certificate is not trusted. 如果无法创建此类信任链,则证书不可信。 Which CA certificates are used as trust anchor depends on the client: browsers like Firefox come with its own trust store, other browsers use the systems trust store, other clients use yet another trust store (ie Java comes with its own). 哪种CA证书用作信任锚取决于客户端:像Firefox这样的浏览器带有自己的信任库,其他浏览器使用系统信任库,其他客户端使用另一个信任库(即Java带有自己的信任库)。 See SSL Certificate framework 101: How does the browser actually verify the validity of a given server certificate? 请参阅SSL证书框架101:浏览器如何实际验证给定服务器证书的有效性? for more details. 更多细节。

Now in case of Self-signed, .... So in this scenario, we have the same Public/Private Key pair used both during certificate signing and also to share the symmetric key for data encryption(Q3)?? 现在,在自签名的情况下,....因此,在这种情况下,我们在证书签名期间使用了相同的公钥/私钥对,并且还为数据加密(Q3)共享了对称密钥?

With self-signed certificate the issuer and of the certificate is the certificate itself, ie the private key used to sign the certificate matches the public key inside the certificate. 对于自签名证书,颁发者和证书的颁发者是证书本身,即,用于对证书进行签名的私钥与证书内部的公钥匹配。 In case of RSA key exchange this key is also involved in creating the symmetric keys (see above). 在使用RSA密钥交换的情况下,此密钥还涉及创建对称密钥(请参见上文)。

Certificate import would have imported the Public key as well to validate signature correct(Q4)? 证书导入是否也会导入公钥以验证签名正确(Q4)?

The public key is part of the certificate (but the private key not). 公钥是证书的一部分(但私钥不是)。 Thus a certificate import will implicitly import the public key too. 因此,证书导入也将隐式导入公钥。

Blogs say if certificate exists in Trusted Root certificates, it is considered valid. 博客说,如果“受信任的根”证书中存在证书,则认为该证书有效。 Does it mean browser dont do Signature validation(Q5)? 这是否意味着浏览器不执行签名验证(Q5)?

A root certificate is considered trusted because it is in the local trust store, not because it is signed by something. 根证书被认为是受信任的,因为它在本地信任存储中,而不是因为它是由某些东西签名的。 That's why signature validation is not really relevant for root certificates. 这就是为什么签名验证与根证书并不真正相关的原因。 To properly work as a trust anchor SSL/TLS libraries still often require the root certificate to be a properly (self-)signed certificate. 为了正确地用作信任锚,SSL / TLS库仍然经常要求根证书是正确的(自签名)证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM