Skip to content

Upgrading packages from private repositories fails using cert and client-cert  #3483

@settingorange

Description

@settingorange
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • Poetry version: 1.1.4

Issue

To configure the cert and client-cert I am using:

poetry config certificates.private-pypi.cert /path/to/ca.crt
poetry config certificates.private-pypi.client-cert /path/to/client.pem

... from the custom CA & TLS instructions.

And from pyproject.toml:

[[tool.poetry.source]]
name = "private-pypi"
url = "https://private-pypi/simple"

When doing a poetry update to get the latest packages, it fails to get packages from private repositories.

It fails with:

Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
 failed: self signed certificate in certificate chain (_ssl.c:1091)'))

... I started to debug that error it looked like the cert and CA were simply not provided in the http request. Actually here's what I saw:

A single successful request where the cert and CA were passed:

GET https://private-pypi/simple/<package_name>/

And then 5 failed retries that had the SSLCertVerificationError:

GET https://private-pypi/packages/<package_name>/<package>-py3-none-any.whl#md5=blah

And in those 5 requests it looked like the cert and CA were not provided. So in my CI build I am not able to install <package> which happens to be an upgrade. I believe this started to happen with 1.1.0 as I can force version 1.0.10 and then the CI build will succeed and the package will install successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions