Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build HTTP client, could not load PEM file #1701

Closed
mattmess1221 opened this issue Feb 19, 2024 · 8 comments
Closed

Failed to build HTTP client, could not load PEM file #1701

mattmess1221 opened this issue Feb 19, 2024 · 8 comments
Labels
bug Something isn't working network Network connectivity e.g. proxies, DNS, and SSL upstream An upstream dependency is involved

Comments

@mattmess1221
Copy link

All commands that connect to the internet are failing when trying to load the local CAFILE. I do have some private certs installed, so it may be related.

Command: uv venv --seed
Platform: Debian 10
UV Version: 0.1.5
ca-certificates.crt

The cafile loaded fine in uv 0.1.2, so this is a regression.

Error output:

$ uv --version
uv 0.1.5
$ RUST_BACKTRACE=full uv venv --seed 
Using Python 3.11.0 interpreter at /usr/software/pkgs/Python-3.11.0/bin/python3.11
Creating virtualenv at: .venv
thread 'main' panicked at crates/uv-client/src/registry_client.rs:87:33:
Failed to build HTTP client.: reqwest::Error { kind: Builder, source: Custom { kind: InvalidData, error: "Could not load PEM file \"/usr/lib/ssl/certs/ca-certificates.crt\": Invalid byte 32, offset 0." } }
stack backtrace:
   0:     0x55ed8874602c - <unknown>
   1:     0x55ed88779150 - <unknown>
   2:     0x55ed88741f4f - <unknown>
   3:     0x55ed88745e14 - <unknown>
   4:     0x55ed88747c77 - <unknown>
   5:     0x55ed887479df - <unknown>
   6:     0x55ed887480f8 - <unknown>
   7:     0x55ed88747fde - <unknown>
   8:     0x55ed887464f6 - <unknown>
   9:     0x55ed88747d42 - <unknown>
  10:     0x55ed87792cf5 - <unknown>
  11:     0x55ed87793233 - <unknown>
  12:     0x55ed87e42a26 - <unknown>
  13:     0x55ed87af85ec - <unknown>
  14:     0x55ed87afda1d - <unknown>
  15:     0x55ed87adac96 - <unknown>
  16:     0x55ed879e7776 - <unknown>
  17:     0x55ed87b23831 - <unknown>
  18:     0x55ed878436e3 - <unknown>
  19:     0x55ed87ac5499 - <unknown>
  20:     0x55ed88737937 - <unknown>
  21:     0x55ed87ac548e - <unknown>
  22:     0x7f20f290ad0a - __libc_start_main
  23:     0x55ed87793549 - <unknown>
  24:                0x0 - <unknown>
@mattmess1221
Copy link
Author

Likely introduced by #1512

@zanieb zanieb added the bug Something isn't working label Feb 19, 2024
@zanieb
Copy link
Member

zanieb commented Feb 19, 2024

Presumably the certificate was not being loaded at all prior to #1512, is it a valid certificate? This might be an upstream bug.

I wonder if we can fallback to using bundled certificates if we fail to load the system store like this, cc @BurntSushi

@mattmess1221
Copy link
Author

mattmess1221 commented Feb 19, 2024

curl/openssl is able to load it fine, so I would assume so.

@zanieb
Copy link
Member

zanieb commented Feb 22, 2024

I'm not sure what to do about this, unfortunately. You may need to open this as an issue upstream or do some more debugging yourself. We're not in control of certificate validation.

@zanieb zanieb added the needs-mre Needs more information for reproduction label Feb 22, 2024
@mattmess1221
Copy link
Author

I figured out the issue was caused by there being indentation in the pem file (for some reason). I've created an issue upstream at rustls/pemfile#40

@zanieb
Copy link
Member

zanieb commented Feb 26, 2024

Thank you!

@zanieb zanieb added upstream An upstream dependency is involved network Network connectivity e.g. proxies, DNS, and SSL and removed needs-mre Needs more information for reproduction labels Feb 26, 2024
@mattmess1221
Copy link
Author

The bug was fixed in rustls-pemfile v2.1.1, however reqwest is still using v1.0.

Likely blocked by seanmonstar/reqwest#2136

@zanieb
Copy link
Member

zanieb commented Jun 7, 2024

Thank you for checking back in @killjoy1221!

We're on rustls-pemfile v2.1.2 now.

@zanieb zanieb closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working network Network connectivity e.g. proxies, DNS, and SSL upstream An upstream dependency is involved
Projects
None yet
Development

No branches or pull requests

2 participants