Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@ authors = ["Markus Thielen <markus.thielen@basebox.tech>"]
keywords = ["jose", "jwt", "openid-connect", "crypto"]
description = "A simple to use, well documented JWT validation library, mainly for validating OpenID Connect ID Tokens."

[features]
# Keep current behavior as default (OpenSSL via `native-tls).
default = ["tls-native"]
# Re-export reqwest's TLS backends as features.
# Users of the library can enable `tls-rustls` (Rustls) if they prefer using it for TLS handling over OpenSSL with `native-tls`.
tls-native = ["reqwest/native-tls"]
tls-rustls = ["reqwest/rustls-tls"]

[dependencies]
url = { version = "2.1" }
thiserror = "1.0"
base64 = "0.21"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
reqwest = { version = "0.12" }
# Turn off `reqwest` defaults to control the TLS feature surface with the `features` setup for tls.
reqwest = { version = "0.12", default-features = false }
ring = { version = "0.17.13", features = ["std"] }
simple_asn1 = "0.6.2"
pem = "3.0.1"
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@ async fn main() {
}
```

### TLS backend configuration (`native-tls` vs `rustls`)

By default, `bbjwt` uses OpenSSL via `native-tls` (the default `reqwest` TLS backend).
It can be overriden with Rusttls instead, which is a pure-Rust TLS implementation, by enabling the `tls-rustls feature:

```
bbjwt = { version = "0.x.y", default-features = false, features = ["tls-rustls"] }
```

To stick with the default OpenSSL-based setup, `bbjwt` should be declared as a regular dependency:

```
bbjwt = "0.x.y"
```

Copyright (c) 2022 basebox GmbH, all rights reserved.

Expand Down