NGINX合并服务器证书和中级证书

导读:

安装证书到nginx 服务器上,有些用户会因为没有合并服务器证书和中级证书,导致部分浏览器浏览网站时,浏览器提示证书不可信。

下载合并好的证书

在证书订单页面,点击下载证书,解压后,里面有一个nginx文件夹,里面的 server.crt 这个文件包含了服务器证书和中级证书,可直接安装到服务器上

自动合并证书链

可以使用这个网址提供的补齐证书链服务,在文本框内粘贴上服务器证书代码,提交后,会自动获取该证书对应的中级证书,并提供合并好的证书文件下载

证书链补齐 https://www.sslaaa.com/tools/get_chain

手动合并证书

用记事本打开 服务器证书 和中级证书,分别复制里面的全部代码,新建一个文本文件,按照顺序分别粘贴服务器证书代码,和 中级证书代码,然后把这个新文件后缀改为 .crt  或 .pem  .cer 即可 

-----BEGIN CERTIFICATE-----
MIIFrzCCBJegAwIBAgIQGp+bOhoJWsQAT5TZN2P8/DANBgkqhkiG9w0BAQsFADCB
jzELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBxMHU2FsZm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTcwNQYDVQQD
Ey5TZWN0aWdvIFJTQSBEb21haW4gVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB
MB4XDTIwMDIyNjAwMDAwMFoXDTIwMDMyNzIzNTk1OVowFDESMBAGA1UEAxMJc3Ns
YWFhLmNuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2tRrCJoGY/r8
yEq5JK/RNMRALjFDrjj+Wbp4TItwgNmoYav4LhHFi2cyFe3ngnYeqdNc1eg/bFdY
WrV5rpxtzz6fonMgT4qstmrt5Rtsq3Uxm+YNr92g1pY998iOnb/mcINQnCvkJ6L8
K21AqJMk0cD33cVLsjXTbw9OpY1wVUFgmRo5njpwjNMyoAGLCD3S6eTu6UL8wAoh
aW5WYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCMGCCsGAQUFBzABhhdod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7o81DgGotPmjw7jtHFtQELFhLRAlSv0ZaBIefYdgWOWnU914Ph85I6p
0fKtirOMxyHNwu8=
-----END CERTIFICATE-----

 

上面的例子中一共有三段代码,其中第一段是服务器证书代码,第二,第三段代码是中级证书代码,有的CA签发的证书中级证书代码仅有一段,有的有两段。Sectigo的中级证书有两段代码。

 

 

咨询热线 4006-325-006