Got error:1E08010C:DECODER routines::unsupported @ courier-imap

Hi All

I'm using Let's Encrypt with Apache & vsftpd work fine.
Version: FreeBSD 14.3 amd64, OpeSSL v3.0 bundle, certbot: v4.0

Only courier-imap have problem from 2~3 years ago as follows.

imapd-ssl[91929]: ip=[fd00::ffff:a00:3fe], couriertls: /usr/local/etc/courier-imap/certificate/fullchain.pem: error:1E08010C:DECODER routines::unsupported

Config of courier-imap is

TLS_CERTFILE=/usr/local/etc/courier-imap/certificate/fullchain.pem
TLS_PRIVATE_KEYFILE=/usr/local/etc/courier-imap/certificate/privkey.pem
  1. I had been asking in courier-imap forum, answer was build it in clean environment and try again, I did but problem still.
  2. Tried pre-build binary package problem still.
  3. Change file of TLS_CERTFILE either cert.pem or chain.pem problem still.
  4. Content of renew hook
    [renewalparams]
    ...
    server = https://acme-v02.api.letsencrypt.org/directory
    authenticator = dns-rfc2136
    rsa_key_size = 4096
    key_type = ecdsa
    elliptic_curve = secp384r1

Can help me to debug?
Thanks all.

Have you tried disabling IPv6?

5 Likes

Have you always used an ECDSA certificate? Per searching that error usually relates to a unknown or problem private key. Please do not post the private key here that would require Let's Encrypt to revoke your cert. And, if that same cert and key are working with Apache it must be valid at least to that.

Maybe try reissuing as RSA cert? Use --key-type rsa

4 Likes

Hi @rg305

I rebuild courier-imap without IPv6 support and got same problem as follows

Jul 24 11:02:49 mail imapd-ssl[90105]: ip=[42.70.211.165], couriertls: /usr/local/etc/courier-imap/certificate/fullchain.pem: error:1E08010C:DECODER routines::unsupported

Thanks you a lot.

Hi @MikeMcQ

Yes, using ECDSA certificate since 2022 (Added line of +key_type = ecdsa).
Based on my (mistake?) impression, courier-imap did not report the problem in 2022?

In my system, all daemon using only one cert and key pair, but only courier-imap got problem...
I will try reissuing as RSA cert use --key-type rsa
Ouch...I'm very sorry, I forgot correct resissue method, please hint me?

Thanks you very much.

What is output of

sudo certbot certificates

Can you explain this more? Has this been working with courier-imap since 2022 and only now started failing?

Are you using a very old version of courier-imap? Because before 2018 it required the private key to be in the same file as the certificate. There was no tls_private_keyfile option back then.

4 Likes

Output:

# certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: epopen.com
    Serial Number: 6bb1300cc89020d89e81bd66a3ca286af1b
    Key Type: ECDSA
    Domains: epopen.com *.epopen.com
    Expiry Date: 2025-10-02 20:50:30+00:00 (VALID: 70 days)
    Certificate Path: /usr/local/etc/letsencrypt/live/epopen.com/fullchain.pem
    Private Key Path: /usr/local/etc/letsencrypt/live/epopen.com/privkey.pem

Is modify "renew_before_expiry = 30 days" to 80 days and execute certbot to renew recommended?

courier-imap work well before 2022 or 2023 , and later failing I remember...

No, I follow latest courier-imap with FreeBSD ports always, current version: courier-imap-5.2.11.
I remember your said tls_private_keyfile, because I using courier-imap from 2010 :laughing:

1 Like

This should work to try RSA cert

sudo certbot renew --cert-name epopen.com --key-type rsa  --force-renewal 

Re-run certbot certificates to verify new Key Type after

Note this is one of the rare times to use --force-renewal. Use it just ONCE. There is no need to manually set/reset the renewal days.

Also, your courier config directory is different than Certbot's. Are you sure the courier files are the same as Certbot's? Could they have become corrupt or damaged in some way?

4 Likes

Hi @MikeMcQ

I ran your suggestion command and result as follows.

n]# certbot renew --cert-name epopen.com --key-type rsa --force-renewal
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /usr/local/etc/letsencrypt/renewal/epopen.com.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renewing an existing certificate for epopen.com and *.epopen.com
...(Customization deploy procedure)
Hook 'deploy-hook' ran with output:
 Start certbot deploy certificate hook for daemon of 'courier-imap-imapd' in jail
...(Customization deploy procedure)
 The domain of 'epopen.com' certificate file deploy successfully.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all renewals succeeded:
  /usr/local/etc/letsencrypt/live/epopen.com/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Hook 'post-hook' reported error code 1
Hook 'post-hook' ran with error output:
 find: /usr/local/etc/letsencrypt/csr: No such file or directory
# certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: epopen.com
    Serial Number: 57c52fa59f9e5981ad4193f0686ffc17f7e
    Key Type: RSA
    Domains: epopen.com *.epopen.com
    Expiry Date: 2025-10-23 16:05:39+00:00 (VALID: 89 days)
    Certificate Path: /usr/local/etc/letsencrypt/live/epopen.com/fullchain.pem
    Private Key Path: /usr/local/etc/letsencrypt/live/epopen.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

All fine look like, and restart "courier-imap" daemon to let it use RSA version certificate.

Back to log of 'courier-imap', got same error as follows. :sweat_smile:
Courier-imap issue look like...

Jul 26 01:08:18 mail imapd-ssl[68235]: ip=[fd00::ffff:a00:3fe], couriertls: /usr/local/etc/courier-imap/certificate/fullchain.pem: error:1E08010C:DECODER routines::unsupported

Sorry you confusing caused. :dotted_line_face:
Because courier-imap runing in jail environment, path of certificate file different than host.
Both synchronize via customization deploy-hook. :slightly_smiling_face:

Thanks you very much.

Certbot no longer saves the csr file so you can remove that from your post-hook. It was only a temporary file anyway.

As for original error don't have any other guesses.

If you view the certs manually in the courier-imap directory do they look correct? Even use something like diff or cmp to compare them to ensure they copied correctly. Or run md5sum on each and compare hashes

Maybe I do have another guess :slight_smile: does that mail program need to be told these are .pem files?

2 Likes

They have openssl V3 per first post. And, have described recompiling Courier IMAP

Do you know of a way to check the version it was compiled with?

Please review the first post and provide more details of the fix you describe. As it is it looks like a quick copy/paste from an AI or web search not directly related to this person's problem.

2 Likes

Thanks you, script fixed. :smiley:

Yes, I compared both and result with follows..

# diff /usr/local/etc/letsencrypt/live/epopen.com/fullchain.pem [JAIL]/usr/local/etc/courier-imap/certificate/fullchain.pem
#
# diff /usr/local/etc/letsencrypt/live/epopen.com/privkey.pem [JAIL]/usr/local/etc/courier-imap/certificate/privkey.pem
#

Both pem files identical :grin:

TLS_CERTFILE and TLS_PRIVATE_KEYFILE require I known currently.
Other relation configure no idea need or not as follows. :upside_down_face:

TLS_DHCERTFILE
PEM file that stores our Diffie-Hellman cipher pair.
When OpenSSL is compiled to use Diffie-Hellman ciphers instead of RSA you must generate a DH pair that will be used.
In most situations the DH pair is to be treated as confidential, and filename must not be world-readable.

TLS_TRUSTCERTS
Load trusted root certificates from *`pathname`*. *`pathname`* can be a file or a directory.
If a file, the file should contain a list of trusted certificates, in PEM format.
If a directory, the directory should contain the trusted certificates, in PEM format, one per file and hashed using OpenSSL's **c_rehash** script. 
`TLS_TRUSTCERTS` is used by SSL/TLS clients (by specifying the `-domain` option) and by SSL/TLS servers (`TLS_VERIFYPEER` is set to `PEER` or `REQUIREPEER`).

Thanks you.

1 Like

Hi @jackqasim

Thanks your suggestion.
Not only recompiled Courier IMAP, but also tried pkg (pre-build) version, error still. :sweat_smile:

I see a thread on the Courier mailing list that might help: Thread: [courier-users] Problems connecting to imap after upgrade of openssl to v3 | Courier Mail Server

If not, try posting a new request there per: The Courier mail server FAQ

Or try the FreeBSD forum but I'd try the mailing list first.

4 Likes

I got it :+1:

I am grateful for your support. :smiley:

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.