Skip to content

chore(lite): install aws-lc-rs as default crypto provider for rustls#171

Merged
shikhar merged 1 commit intomainfrom
rustls-provider
Feb 5, 2026
Merged

chore(lite): install aws-lc-rs as default crypto provider for rustls#171
shikhar merged 1 commit intomainfrom
rustls-provider

Conversation

@shikhar
Copy link
Copy Markdown
Member

@shikhar shikhar commented Feb 5, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This PR adds explicit initialization of the aws-lc-rs crypto provider for rustls in both the CLI and lite server binaries. Both binaries now call install_rustls_crypto_provider() at startup to configure aws-lc-rs as the default cryptographic backend.

Changes:

  • Added rustls dependency with aws-lc-rs feature to workspace and both cli and lite crates
  • Added install_rustls_crypto_provider() function in cli/src/main.rs and lite/src/bin/server.rs
  • Both functions are called early in main() before other initialization

Analysis:
The implementation is straightforward and follows common rustls patterns. Both binaries already use rustls indirectly through axum-server with the tls-rustls feature, so this change ensures aws-lc-rs is explicitly chosen as the crypto provider. Since each function is only called once per binary execution in main(), the .expect() on install_default() is safe and will not cause issues.

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • The changes are minimal, well-contained, and follow established patterns for initializing rustls crypto providers. The implementation is consistent across both binaries, and the early initialization in main() ensures no conflicts. No breaking changes or edge cases identified.
  • No files require special attention

Important Files Changed

Filename Overview
cli/src/main.rs Added install_rustls_crypto_provider() function to install aws-lc-rs as default crypto provider at startup
lite/src/bin/server.rs Added install_rustls_crypto_provider() function to install aws-lc-rs as default crypto provider at startup
cli/Cargo.toml Added rustls dependency with aws-lc-rs feature enabled
lite/Cargo.toml Added rustls dependency with aws-lc-rs feature enabled

Sequence Diagram

sequenceDiagram
    participant Main as main()
    participant InstallFn as install_rustls_crypto_provider()
    participant RustlsCrypto as rustls::crypto::aws_lc_rs
    participant RustlsGlobal as rustls global state
    
    Main->>InstallFn: call at startup
    InstallFn->>RustlsCrypto: default_provider()
    RustlsCrypto-->>InstallFn: CryptoProvider instance
    InstallFn->>RustlsGlobal: install_default()
    alt Provider not yet installed
        RustlsGlobal-->>InstallFn: Ok(())
        InstallFn-->>Main: success
    else Provider already installed
        RustlsGlobal-->>InstallFn: Err(...)
        InstallFn->>InstallFn: panic via .expect()
    end
    Main->>Main: continue with app initialization
Loading

@shikhar shikhar merged commit 4f2fcf2 into main Feb 5, 2026
11 checks passed
@shikhar shikhar deleted the rustls-provider branch February 5, 2026 19:01
@github-actions github-actions bot mentioned this pull request Feb 5, 2026
quettabit pushed a commit that referenced this pull request Feb 5, 2026
## 🤖 New release

* `s2-lite`: 0.27.3 -> 0.27.4 (✓ API compatible changes)
* `s2-cli`: 0.27.3 -> 0.27.4

<details><summary><i><b>Changelog</b></i></summary><p>

## `s2-lite`

<blockquote>

## [0.27.4] - 2026-02-05

### Miscellaneous Tasks

- Install aws-lc-rs as default crypto provider for rustls
([#171](#171))

<!-- generated by git-cliff -->
</blockquote>

## `s2-cli`

<blockquote>

## [0.27.4] - 2026-02-05

### Bug Fixes

- Only set default_stream_config when stream config args provided
([#164](#164))

### Miscellaneous Tasks

- Install aws-lc-rs as default crypto provider for rustls
([#171](#171))

<!-- generated by git-cliff -->
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant