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

Use aws-lc-rs instead of ring for TLS #4734

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

kcon-stackav
Copy link

Summary

This PR switches the TLS backend used by reqwest from ring to aws-lc to support more SSL certificate signature algorithms (especially P521 algorithms which aren't yet supported by ring: briansmith/ring#1631).

Fixes #4534

Test Plan

I used uv pip install to try installing a package from a private PyPI server whose SSL certificate was signed using the ECDSA SHA-512 certificate signature algorithm and, using the Rust debugger, observed that uv did not fail to install the package due to not supporting the ECDSA SHA-512 certificate signature algorithm.

@kcon-stackav kcon-stackav changed the title Explore using aws-lc-rs instead of ring for TLS Use aws-lc-rs instead of ring for TLS Jul 2, 2024
@zanieb zanieb self-assigned this Jul 2, 2024
@zanieb zanieb added the network Network connectivity e.g. proxies, DNS, and SSL label Jul 2, 2024
@zanieb
Copy link
Member

zanieb commented Jul 2, 2024

Thanks for the pull request!

@zanieb
Copy link
Member

zanieb commented Jul 2, 2024

This Windows failure also looks somewhat problematic (see aws/aws-lc#1477 and example fix)

@kcon-stackav kcon-stackav force-pushed the kcon-stackav/use-aws-lc-instead-of-ring branch from 7f091b3 to 34852fe Compare July 2, 2024 22:07
@kcon-stackav kcon-stackav force-pushed the kcon-stackav/use-aws-lc-instead-of-ring branch from 34852fe to 7fdb31c Compare July 2, 2024 22:20
Comment on lines +85 to +86
- name: "Install nasm"
uses: ilammy/setup-nasm@v1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zanieb I'm not very familiar with maturin, do you think installing NASM is needed for the build-binaries Windows job too?

windows:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-build') }}
runs-on: windows-latest
strategy:
matrix:
platform:
- target: x86_64-pc-windows-msvc
arch: x64
- target: i686-pc-windows-msvc
arch: x86

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.github/workflows/ci.yml Show resolved Hide resolved
@kcon-stackav kcon-stackav marked this pull request as ready for review July 2, 2024 22:38
@@ -216,6 +218,9 @@ jobs:
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.DEV_DRIVE }}/uv" -Recurse

- name: "Install nasm"
uses: ilammy/setup-nasm@v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self we should audit this action and consider just implementing it ourself if the install is straightforward

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +142 to +144
if aws_lc_rs::default_provider().install_default().is_err() {
warn_user_once!("Failed to install aws_lc_rs as the default TLS provider.");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the error attached to the result is just Self and has no information, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I understand the error holds the CryptoProvider that was previously installed as the default in that case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could capture it to say what we're using instead but it doesn't seem critical.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah I thought about doing that but I wasn't sure the CryptoProvider had a nice human-readable name field we could use: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network Network connectivity e.g. proxies, DNS, and SSL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid peer certificate: BadSignature when installing package from private index using ECDSA SHA-512 SSL cert
3 participants