Skip to content

Commit

Permalink
Added rustls and native-tls features (#19)
Browse files Browse the repository at this point in the history
* added rustls and native-tls features (fixes #14)

* check feature with github actions
  • Loading branch information
kilork authored Mar 17, 2021
1 parent 77106c8 commit 761f519
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ jobs:
run: cargo build --features uma2
- name: Run tests with UMA2
run: cargo test --verbose --features uma2
- name: Build with rustls
run: cargo build --no-default-features --features rustls
- name: Run tests with rustls
run: cargo test --no-default-features --verbose --features rustls
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ readme = 'README.md'
repository = 'https://github.com/kilork/openid'

[features]
default = []
default = ['native-tls']
microsoft = []
uma2 = []
native-tls = ['reqwest/native-tls']
rustls = ['reqwest/rustls-tls']

[dependencies]
lazy_static = '1.4'
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ Add dependency to Cargo.toml:
openid = "0.8"
```

By default it uses native tls, if you want to use `rustls`:

```toml
[dependencies]
openid = { version = "0.8", default-features = false, features = ["rustls"] }
```

### Use case: [Warp](https://crates.io/crates/warp) web server with [JHipster](https://www.jhipster.tech/) generated frontend and [Google OpenID Connect](https://developers.google.com/identity/protocols/OpenIDConnect)

This example provides only Rust part, assuming just default JHipster frontend settings.
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ Add dependency to Cargo.toml:
openid = "0.8"
```
By default it uses native tls, if you want to use `rustls`:
```toml
[dependencies]
openid = { version = "0.8", default-features = false, features = ["rustls"] }
```
### Use case: [Warp](https://crates.io/crates/warp) web server with [JHipster](https://www.jhipster.tech/) generated frontend and [Google OpenID Connect](https://developers.google.com/identity/protocols/OpenIDConnect)
This example provides only Rust part, assuming just default JHipster frontend settings.
Expand Down

0 comments on commit 761f519

Please sign in to comment.