Skip to content

sslv3 alert bad certificate #1069

Closed
@pidario

Description

@pidario

Context:
OS: Arch
vdirsyncer v0.19.x
python v3.11.3

This applies to vdirsyncer (v0.19.0 and v0.19.1) installed from either pipx, pip or community arch repository.

I use xandikos server behind a reverse proxy. I use mutual TLS authentication, the configuration is the following:

[general]
status_path = "/path/to/vdirsyncer/status/"

[pair contacts]
a = "contacts_local"
b = "contacts_remote"
collections = ["from a", "from b"]

[storage contacts_local]
type = "filesystem"
path = "/path/to/contacts/"
fileext = ".vcf"

[storage contacts_remote]
type = "carddav"
url = "https://mydavserver"
auth_cert = ["/path/to/cert.pem", "/path/to/key.pem"]
verify = "/etc/ssl/cert.pem"

This started to happen after python 3.11 update:
whenever I try to launch vdirsyncer discover I get the following error:
error: Unknown error occurred: [Errno 1] [SSL: SSLV3_ALERT_BAD_CERTIFICATE] sslv3 alert bad certificate (_ssl.c:2576)

It looks like vdirsyncer is not using the client certificate and key because if I manually add in this if block this line of code:

ssl.load_cert_chain(*self._settings["cert"])

the error is gone.

On a side note, I also had to add the line verify = "/etc/ssl/cert.pem" to my configuration, which I didn't have before. If I omit it, I get that same error from before. Maybe there was a change in the python module ecosystem that stopped the modules from using OS certificates bundle?

Downgrading to v0.18.0 fixes both issues.

Any idea what might have gone wrong with the upgrade to 0.19?
Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions