Following on from the StartCOM verus Apple issues I mentioned yesterday, I have created a new 4K certificate from StartCOM. Apple has no problem with that certificate.
I was in the process of setting up some test servers:
- Dovecot with a 2048-bit cert
- Dovecot with a 4096-bit cert
- Cyrus with a 2048-bit cert
- Cyrus with a 4096-bit cert
I started with Dovecot and was testing each one as I set it up.
As expected, the 2048-bit cert worked.
Unexpectedly, so did the newly created 4096-bit cert in the langille.org domain.
Confused, I compare the two dovecot configuration files. They were the same but for address and certificate related files.
In both cases, the ssl_cert paramer pointed to a file which was constructed by a command like this:
cat imaps.unixathome.org.crt sub.class2.server.ca.pem ca.pem > imaps.crt
Here is the connection for the 4098 bit cert which fails:
$ openssl s_client -CAfile /usr/local/share/certs/ca-root-nss.crt -connect dovecot4096.langille.org:993 CONNECTED(00000003) depth=2 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority verify return:1 depth=1 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA verify return:1 depth=0 /description=VwhdJi0sLHP3BDtQ/C=US/ST=Pennsylvania/L=Media/O=Daniel Langille/CN=imaps.unixathome.org/emailAddress=postmaster@unixathome.org verify return:1 --- Certificate chain 0 s:/description=VwhdJi0sLHP3BDtQ/C=US/ST=Pennsylvania/L=Media/O=Daniel Langille/CN=imaps.unixathome.org/emailAddress=postmaster@unixathome.org i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA 1 s:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority 2 s:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority --- Server certificate -----BEGIN CERTIFICATE----- MIIHsjCCBp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zAChjZodHRwOi8vYWlhLnN0YXJ0c3NsLmNvbS9j ZXJ0cy9zdWIuY2xhc3MyLnNlcnZlci5jYS5jcnQwIwYDVR0SBBwwGoYYaHR0cDov L3d3dy5zdGFydHNzbC5jb20vMA0GCSqGSIb3DQEBBQUAA4IBAQBHkfLREbnBtJUE MPDsaHEZSEDe5uagtAvuNMQh03qcu5UG2x5KkjeT6OK7JwrrjEehA+m5t2JcGtPY dLN8VB9w7WdPg4ezNR/F4sKdeOPNl8+Us5pWMXRPnLN8EqAp4Kg5KzfJli8Jnaxw Snbs1Itmwxm19lYF2nWPUMMBru4CxHN7U5jbii+wqpi3LhRK/okuMEbG7xogcboP n2CDTFk6Yc9W0BE7XBwr1t0xE8KFgvlKu87RS3C+d1AkzM92NUDgS0JQgmO6F2T/ nBsediEpNGORzEvSuq/4wVych5tUKFkksy5X4CHXZw86YjZccPcrtpLrWxs5EhUD s+tkDOSK -----END CERTIFICATE----- subject=/description=VwhdJi0sLHP3BDtQ/C=US/ST=Pennsylvania/L=Media/O=Daniel Langille/CN=imaps.unixathome.org/emailAddress=postmaster@unixathome.org issuer=/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA --- No client certificate CA names sent --- SSL handshake has read 6525 bytes and written 337 bytes --- New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA Server public key is 4098 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : DHE-RSA-AES256-SHA Session-ID: 4AEF3F9EFC0F204597B2544B866BFB546D63FD6F2C07C35059BF49FF331B8F99 Session-ID-ctx: Master-Key: 3C9AB1FB6D69A1A96851A4C38A04DEBF468E17175D038081CEFF95530C921A91BEE1224CD0AAECE52DB6931DADC2B21B Key-Arg : None Start Time: 1381436890 Timeout : 300 (sec) Verify return code: 0 (ok) --- * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
Notice, it’s 4098 bits. Not 4096 bits as I thought it was. That, I believe, is the key to the problem.
And this is the certificate which succeeds:
$ openssl s_client -CAfile /usr/local/share/certs/ca-root-nss.crt -connect dovecot4096.langille.org:993 CONNECTED(00000003) depth=2 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority verify return:1 depth=1 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA verify return:1 depth=0 /description=3YB45Tqb2mK7H7lO/C=US/ST=Pennsylvania/L=Media/O=Daniel Langille/CN=dovecot4096.langille.org/emailAddress=postmaster@langille.org verify return:1 --- Certificate chain 0 s:/description=3YB45Tqb2mK7H7lO/C=US/ST=Pennsylvania/L=Media/O=Daniel Langille/CN=dovecot4096.langille.org/emailAddress=postmaster@langille.org i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA 1 s:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority 2 s:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority --- Server certificate -----BEGIN CERTIFICATE----- MIIHtjCCBp6gAwIBAgIDAarmMA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0 YWwgQ2VydGlmaWNhdGUgU2lnbmluZzE4MDYGA1UEAxMvU3RhcnRDb20gQ2xhc3Mg MiBQcmltYXJ5IEludGVybWVkaWF0ZSBTZXJ2ZXIgQ0EwHhcNMTMxMDEwMDkzNDAx WhcNMTUxMDExMT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eq8iyEADV7974bJa1pgy5O753td9Nu3ftqhqGID6/EtGe7WtrcLkAX59 YemLo8GUgTEV8tEIp35KM4qFnhjP9I1IJd2eXc1cJ99kBBM265Qfin0U0VzjsWZo V9jUSeIOq2N8L4fW5ZsJvxXii/O2vLJmDJX0aAzjKjF8A546y4MTcQaUddIDCerQ qF5b3BnSJx0ZSO/BLKPPq/a+/RrD7eb8TFF1fygOMUyiFEGic5RJ+PWg+nV+8Ohb QXQsAh9vU4QTAw== -----END CERTIFICATE----- subject=/description=3YB45Tqb2mK7H7lO/C=US/ST=Pennsylvania/L=Media/O=Daniel Langille/CN=dovecot4096.langille.org/emailAddress=postmaster@langille.org issuer=/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA --- No client certificate CA names sent --- SSL handshake has read 6528 bytes and written 337 bytes --- New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA Server public key is 4096 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : DHE-RSA-AES256-SHA Session-ID: A0397DB209074D4C0F44361077F920525DC719F4F426FF6209F4CBF738EBA092 Session-ID-ctx: Master-Key: 422AC3AD9F6BAD8F22F461E7761C27D1C14EBB5950F043311CC7CAF4A0283EA9F013C8E839810945FBDD6AF08C5E18C1 Key-Arg : None Start Time: 1381436961 Timeout : 300 (sec) Verify return code: 0 (ok) --- * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.