Hello,
We are currently testing OpenID Connect authentication with MDaemon Webmail 26.0.1 and Keycloak as the Identity Provider.
Our architecture is the following:
MDaemon Webmail
↓ OIDC
Keycloak
↓
Nginx reverse proxy
We have identified an issue that appears to be related to TLS negotiation when the following Nginx directives are enabled:
ssl_client_certificate /certs/root.pem;
ssl_verify_client optional;
These settings are required in our environment because we use client certificate authentication for other applications behind the same reverse proxy.
Symptoms:
- MDaemon fails to retrieve the OIDC configuration from the
.well-known/openid-configuration endpoint.
- OIDC configuration and authentication fail.
- The same URL is accessible without any problem from a web browser running on the MDaemon server.
- Using PowerShell
Invoke-WebRequest also succeeds.
- Using
curl with Schannel shows TLS renegotiation requests from the server:
schannel: remote party requests renegotiation
schannel: renegotiating SSL/TLS connection
schannel: SSL/TLS connection renegotiated
Most importantly:
- As soon as we disable the following directives:
ssl_client_certificate /certs/root.pem;
ssl_verify_client optional;
MDaemon is immediately able to retrieve the OIDC configuration and authentication works correctly.
This makes us suspect that MDaemon may have difficulties handling TLS connections when the server requests an optional client certificate during the TLS handshake.
Has anyone experienced a similar issue with OIDC providers behind Nginx using:
ssl_verify_client optional;
or mutual TLS configurations?
Are there any known limitations in MDaemon's OIDC implementation regarding TLS renegotiation or optional client certificate requests?
Any advice or recommended architecture would be greatly appreciated.
Best regards,