Kopano SSL Handshake Errors on Custom Ports: What to Check

If Kopano reports an SSL handshake error after you move its Core HTTPS listener to a custom port, first confirm that server_listen_tls binds that port and that every connecting client uses the same HTTPS endpoint. Then check the server certificate and client trust or certificate authentication; opening a TCP port alone does not establish a working TLS service.

The examples below use mail.example.net:8443 instead of Kopano Core’s documented TLS port 237. Replace these examples with your hostname, port, and certificates. This covers the Kopano Core SOAP/HTTPS endpoint, not WebApp or IMAPS/SMTP ports.

1. Identify where the TLS handshake fails

Check the server before changing certificates. On the Kopano Core host, find the process listening on the custom port:

sudo ss -ltnp | grep :8443
A dark Linux terminal showing the ss listener list for TCP port 8443 on IPv4 and IPv6.
The listening-socket check confirms that a process has bound the example port 8443, but not that it speaks TLS.

Look for a LISTEN entry bound to the address clients actually reach. No listener means checking startup logs and configuration. A service bound only to 127.0.0.1 cannot serve remote clients; a different port owner signals a conflict.

Next, from a machine on the same network path as the failing client, ask OpenSSL to start a TLS session:

openssl s_client -connect mail.example.net:8443 \
  -servername mail.example.net -showcerts </dev/null
A terminal running an OpenSSL connection check against mail.example.net port 8443, with no peer certificate available.
An OpenSSL diagnostic that reports no peer certificate points to a failed handshake, not a successful secure connection.

The -servername value supplies the TLS server name; -showcerts displays certificates the peer sends. Interpret the result before acting:

Observed resultNext check
Connection refused or timed outListener address, service state, firewall, routing, or load balancer
No peer certificate or wrong-version errorWhether the port actually serves TLS rather than plaintext HTTP or another protocol
A certificate is shown but verification failsCertificate chain, CA trust, hostname, and expiration
Handshake completes, but Kopano login failsClient authentication, application endpoint, or permissions instead of transport TLS

A successful TCP connection or the word CONNECTED alone does not prove successful TLS negotiation. For options and output details, consult the OpenSSL s_client manual

2. Set the TLS listener in Kopano Core

Back up /etc/kopano/server.cfg, then inspect its effective settings. For Kopano Core 8.7-era configurations, the key listener directive is server_listen_tls:

sudo cp -a /etc/kopano/server.cfg /etc/kopano/server.cfg.bak
sudo grep -nE "^(server_listen_tls|server_listen|server_ssl_)" /etc/kopano/server.cfg
server_listen_tls = *:8443
server_ssl_ca_file = /etc/kopano/ssl/ca.pem
server_ssl_key_file = /etc/kopano/ssl/server.pem
# Set server_ssl_key_pass only if the PEM key is encrypted.
A text editor showing the Kopano server.cfg file, with server_listen_tls configured for port 8443 and certificate file paths below.
The sample server.cfg listener uses server_listen_tls for the custom port and lists the PEM and CA file paths.

File paths are examples. Kopano’s server PEM can contain the certificate and private key; server_ssl_ca_file identifies the CA for client-certificate validation. Check man kopano-server.cfg for your installed build’s PEM and passphrase requirements.

A critical version distinction: Kopano’s Core changelog identifies server_ssl_enabled and server_ssl_port as deprecated in the 8.7 changes, replaced by listener directives already available in 8.6.x. Do not copy obsolete settings from an older installation without checking the package. See the official Core configuration changelog and the Kopano Core administrator instructions.

A wildcard listener exposes every applicable interface; restrict access using host-firewall or network policy.

3. Check the certificate, chain, and names

Inspect the certificate referenced by server_ssl_key_file. The command below reads the certificate portion of the PEM and displays its validity period and names:

sudo openssl x509 -in /etc/kopano/ssl/server.pem \
  -noout -dates -subject -ext subjectAltName
A terminal displaying an openssl x509 command for checking a Kopano certificate file’s dates, subject, and subject alternative names.
Inspect the certificate actually configured for Kopano and compare its names with the hostname used by clients.

Confirm that the certificate is currently valid and includes the exact DNS name clients use, such as mail.example.net. Kopano’s documentation notes that components check the certificate common name and subject alternative names beginning with Core 8.2.0. Connecting by IP address when only a DNS name is covered can therefore fail name checks.

Ensure the private key matches the certificate, the Kopano service can read it, and any required intermediate certificate is present. Never use chmod 777 or disable verification to hide a permissions or trust failure.

For an internal CA, test the chain and hostname explicitly from the client machine, using that CA’s trusted public certificate:

openssl s_client -connect mail.example.net:8443 \
  -servername mail.example.net \
  -CAfile /path/to/trusted-ca.pem \
  -verify_hostname mail.example.net -verify_return_error -brief </dev/null

Replace the CA file with the appropriate trust anchor. An output indicating successful peer verification supports certificate trust, but it does not prove Kopano application authentication. If the server requests a client certificate, configure the proper Kopano client certificate as described in the official remote-components certificate guidance.

4. Update every client endpoint using the custom port

After the listener changes, an application still pointing to port 237, port 236, or an http:// URL will not use the intended HTTPS endpoint. For a remotely hosted WebApp, inspect the WebApp config.php and set its documented Core socket definition to the correct target:

define("DEFAULT_SERVER", "https://mail.example.net:8443/kopano");

This is a PHP setting inside the existing WebApp configuration, not a directive for server.cfg. The actual config.php location depends on how WebApp was installed. The WebApp configuration reference documents DEFAULT_SERVER and, for certificate-authenticated remote connections, SSLCERT_FILE and SSLCERT_PASS.

For an external Kopano component such as kopano-dagent, check that its own configuration uses the matching endpoint. When the component must authenticate using a client certificate, verify its sslkey_file and sslkey_pass values as well:

server_socket = https://mail.example.net:8443/kopano
sslkey_file = /etc/kopano/ssl/client.pem

Client-certificate requirements depend on authentication settings. Never distribute the server private key to clients. Keep an existing same-host Unix-socket connection unless remote TLS is needed.

5. Restart the affected service and inspect its logs

After confirming paths and permissions, restart Kopano Core during an appropriate maintenance window. Changing the listener may briefly interrupt clients:

sudo systemctl restart kopano-server
sudo systemctl status kopano-server --no-pager
sudo journalctl -u kopano-server -n 80 --no-pager

Look for bind failures, missing PEM files, unreadable keys, passphrase problems, and TLS initialization errors. If startup fails, restore the backup and resolve the logged cause. Restart affected clients when their configurations change.

If TLS works but login fails, investigate client certificates or Kopano authentication. On older builds, check the installed Kopano and OpenSSL versions for protocol compatibility; do not enable obsolete TLS or disable certificate checks.

Verify the repaired connection

  1. ss -ltnp shows the intended Kopano listener on the intended local address and custom port.
  2. openssl s_client completes TLS negotiation and validates the peer against the correct CA and hostname.
  3. The Kopano server log stays free of new TLS initialization errors after restart.
  4. The actual WebApp or remote Kopano component can authenticate and access its expected mailbox data over the updated endpoint.

If checks one through three pass but the application still fails, continue with the client’s certificate-authentication settings and application logs. A working TLS handshake is necessary for this HTTPS setup, but it is not the same as a successful Kopano session.

Leave a Comment

How to