Skip to content

Commit

Permalink
Merge pull request #26 from traPtitech/optional-rustls
Browse files Browse the repository at this point in the history
rustlsを選択可能にする
  • Loading branch information
H1rono authored Jul 30, 2024
2 parents 59501b2 + a083fb9 commit 1801ad4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ documentation = "https://github.com/traPtitech/rust-traq/tree/main/docs"
keywords = ["traq", "openapi"]
edition = "2021"

[features]
default = ["native-tls"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]

[dependencies]
serde = "^1.0"
serde_derive = "^1.0"
serde_json = "^1.0"
serde_repr = "^0.1"
url = "^2.5"
uuid = { version = "^1.0", features = ["serde"] }

[dependencies.reqwest]
version = "^0.12"
features = ["json", "multipart"]
default-features = false
features = ["json", "multipart", "charset", "http2", "macos-system-configuration"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,21 @@ async fn main() {
println!("{:?}", res);
}
```

## TLS Backend

This crate depends on [reqwest](https://crates.io/crates/reqwest) as an HTTPS client. As with reqwest, you can select TLS backend through this crate's feature flags.

- `native-tls`: the system-installed TLS backend
- `rustls-tls`: the TLS library written in Rust

`native-tls` is used by default. To use only `rustls-tls`, write dependencies as:

```toml
[dependencies]
traq.version = "..."
traq.default-features = false
traq.features = ["rustls-tls"]
```

For more information, see [docs in reqwest::tls](https://docs.rs/reqwest/0.12/reqwest/tls/index.html).

0 comments on commit 1801ad4

Please sign in to comment.