Skip to content

[Bug]: Unable to connect with client ssl cert if server response contains Strict-Transport-Security #9281

@rbran

Description

@rbran

⚠️ Before submitting, please verify the following: ⚠️

Bug description

The Desktop client is unable to connect to a server that enforces client side ssl certificated (mTLS, AKA on nginx ssl_verify_client on; ssl_client_certificate /etc/nixos/ca.pem;) if the header Strict-Transport-Security is present on the response.

Steps to reproduce

  • Configure a nextcloud server with nginx.
  • Add the ssl cert client verification, AKA add ssl_verify_client on; ssl_client_certificate /etc/nixos/ca.pem; to nginx.
  • Add the header Strict-Transport-Security to the reply, AKA add add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always; to nginx.

The desktop client will fail to connect with a generic "Failed to connect" message.

  • Remove the Strict-Transport-Security header (aka just remove the nginx config line from above).

The client will work normally offering Configure client-side TLS certificate.

Expected behavior

Expected to open the wizard with the options "Select a diferent URL", "Retry unencrypted over HTTP (insecure)" and "Configure client-side TLS certificate" .

Instead it just show the error message "Failed to connect to Nextcloud ... contact your server administrator for help".

Which files are affected by this bug

Desktop client initial setup

Operating system

Linux

Which version of the operating system you are running.

NixOS 25.11

Package

Other

Nextcloud Server version

32.0.3

Nextcloud Desktop Client version

4.0.4

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

Are you using an external user-backend?

  • Default internal user-backend
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Nextcloud Server logs

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions