Roundcube Community Forum

 

What are the IMAP/SMTP settings for self-signed certificates?

Started by ArnoRoundcube, November 28, 2025, 01:42:27 PM

Previous topic - Next topic

ArnoRoundcube

Hi,

On my LAN Dovecot, Postfix on the one server work fine. Also Thunderbird works fine as an e-mail client.

Now I want to use RC also (on the same server).
So I installed RC and nginx.
My browser shows the login page.

But I can't login
(stream_socket_client(): Failed to enable crypto
Unable to set local cert chain file `/etc/dovecot/private/xxxx.cert'; Check that your cafile/capath settings include details of your certificate and its issuer).

What are the correct RC settings for IMAP/SMTP when using self-signed certificates?
Below is my current configuration.

-----------------------------------------------
Dovecot/Postfix/Thunderbird: OK
Thunderbird: SSL/TLS, Normal password, server: imap.domain.lan:993

Roundcube:
// --------------- IMAP ---------------------------------------

$config['imap_host'] = 'ssl://imap.domain.lan:993';
$config['imap_conn_options'] = [
  'ssl'        => [
    'verify_peer'  => true,
    'verify_peer_name'  => true,
    'verify_depth' => 3,
    'local_cert'  => '/etc/dovecot/ssl/xxxx.cert',
    'local_pk'    => '/etc/dovecot/ssl/xxxx.key',
    'allow_self_signed' => true
  ],
];
$config['imap_auth_type'] = 'PLAIN';

// --------------- SMTP ---------------------------------------

$config['smtp_host'] = 'ssl://smtp.domain.lan:587';
$config['smtp_conn_options'] = [
  'ssl'        => [
    'verify_peer'  => true,
    'verify_peer_name'  => true,
    'verify_depth' => 3,
    'local_cert'  => '/etc/postfix/ssl/cert.pem',
    'local_pk'    => '/etc/postfix/ssl/key.pem',
    'allow_self_signed' => true
  ],
];
$config['smtp_auth_type'] = 'PLAIN';
$config['smtp_user'] = '[email protected]';
$config['$config['smtp_pass' = 'password';

SKaero

Have you verified that the web server has access to read the certificate files you have linked to in the config?

ArnoRoundcube

I think I did but I checked again:

-r-------- 1 root root 1.7K Sep 27  2024 /etc/dovecot/ssl/xxxx.key
changed to
-r--r--r-- 1 root root 1.7K Sep 27  2024 /etc/dovecot/ssl/xxxx.key
and
-rw-r--r-- 1 root root 1.3K Sep 27  2024 /etc/dovecot/ssl/xxxx.cert

roundcubemail/logs/*.log:
Could not connect to ssl://imap.xxx.lan:993:
Unknown reason in /xxxx/xxxx/roundcubemail/program/lib/Roundcube/rcube_imap.php on line 211 (POST /?_task=login&_action=login)