大网数据广告活动
服务器运维问答

Self signed certificate in certificate chain

· 52CE 我爱测

I'm having some problems building a certificate chain. My certificate is a class 2 certificate issued by StartSSL. Here’s what I have put in my ssl.crt: my cert https://www.startssl.com/certs/ca.pem https://www.startssl.com/certs…

问题原文

原帖链接 · MultiformeIngegno · CC BY-SA 4.0

I'm having some problems building a certificate chain. My certificate is a class 2 certificate issued by StartSSL.

Here’s what I have put in my ssl.crt:

my cert
https://www.startssl.com/certs/ca.pem
https://www.startssl.com/certs/class2/sha1/pem/sub.class2.client.sha1.ca.pem
https://www.startssl.com/certs/class2/sha1/pem/sub.class2.server.sha1.ca.pem

If I run a openssl s_client -connect domain.com:993 I get:

Verify return code: 19 (self signed certificate in certificate chain)
---
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready

And if I try to add my account to Gmail here's what I get:

"Missing +OK response upon connecting to the server: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready."

Why does it say it is a self-signed cert?

已采纳解答

原帖链接 · Craig Watson · CC BY-SA 3.0

At some level, a self-signed certificate will always appear in a certificate chain - most notably the case with CA certs, which are by definition self-signed, but are trusted. You are seeing that message because the StartSSL CA cert is self-signed.

Your chain file is also wrong - you don't need the client certificates. The file should be in the following order, from the top of the file to the bottom, links are to StartSSL's equivalent cert, assuming class 2 validation (documentation is here):

  1. Private key (optional)
  2. Your Public certificate
  3. Class 2 Intermediate Certificate
  4. Root CA certificate

Your error could be down to using the wrong port, as discussed here. For reference, port 995 is used for POP SSL connections, port 993 is used for IMAP SSL (reference).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-05-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。