File tree Expand file tree Collapse file tree 7 files changed +59
-35
lines changed
Expand file tree Collapse file tree 7 files changed +59
-35
lines changed Original file line number Diff line number Diff line change 66 check :
77 name : test
88 runs-on : ubuntu-latest
9- strategy :
10- matrix :
11- runtime : ["blocking", "default"]
12- tls : ["native-tls", "rustls"]
13-
149 steps :
1510 - name : Checkout sources
16- uses : actions/checkout@v3
11+ uses : actions/checkout@v6
1712
1813 - name : Install stable toolchain
1914 uses : dtolnay/rust-toolchain@stable
@@ -22,10 +17,16 @@ jobs:
2217 run : cargo fmt --all -- --check
2318
2419 - name : Check clippy
25- run : cargo clippy --features ${{ matrix.runtime }},${{ matrix.tls }} -- -D warnings
20+ run : cargo clippy -- -D warnings
2621
27- - name : Test with ${{ matrix.runtime }} and ${{ matrix.tls }}
28- run : cargo test --features ${{ matrix.runtime }},${{ matrix.tls }}
29-
30- - name : Async test
22+ - name : Test async and rustls
3123 run : cargo test
24+
25+ - name : Test async and native-tls
26+ run : cargo test --features native-tls
27+
28+ - name : Test blocking and rustls
29+ run : cargo test --features blocking
30+
31+ - name : Test blocking and native-tls
32+ run : cargo test --features blocking,native-tls
Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 0.26.0 - 2026-01-17
4+
5+ ### Changed
6+
7+ - The rustls feature is removed.
8+ - ` reqwest ` was updated to 0.13.
9+ - ` date-encoding ` was updated to 2.10.
10+ - Actually allow TLS provider selection for V3 clients.
11+
312## 0.25.0 - 2026-01-10
413
514### Changed
Original file line number Diff line number Diff line change 11[package ]
22name = " sendgrid"
3- version = " 0.25 .0"
3+ version = " 0.26 .0"
44edition = " 2024"
55authors = [" Garrett Squire <github@garrettsquire.com>" ]
66description = " An unofficial client library for the SendGrid API"
@@ -12,22 +12,19 @@ documentation = "https://docs.rs/sendgrid"
1212readme = " README.md"
1313
1414[dependencies ]
15- data-encoding = " 2.9 "
16- reqwest = { version = " 0.12 " , default-features = false , features = [" json" ] }
15+ data-encoding = " 2.10 "
16+ reqwest = { version = " 0.13 " , default-features = false , features = [" json" ] }
1717serde = { version = " 1.0" , features = [" derive" ] }
1818serde_json = " 1.0"
1919thiserror = " 2.0"
2020url = " 2.5"
2121
2222[dev-dependencies ]
23- tokio = { version = " 1.0 " , features = [" full" ] }
23+ tokio = { version = " 1" , features = [" full" ] }
2424
2525[features ]
26- default = [" native-tls" ]
27-
2826blocking = [" reqwest/blocking" ]
29- rustls = [" reqwest/rustls-tls" ]
30- native-tls = [" reqwest/default-tls" ]
27+ native-tls = [" reqwest/native-tls" ]
3128
3229[[example ]]
3330name = " v3_async"
Original file line number Diff line number Diff line change @@ -19,14 +19,14 @@ sendgrid = "X.X.X"
1919```
2020
2121## Build Dependencies
22- This library utilises [ reqwest] ( https://crates.io/crates/reqwest ) . Follow the instructions on the
22+ This library utilizes [ reqwest] ( https://crates.io/crates/reqwest ) . Follow the instructions on the
2323[ reqwest README] ( https://github.com/seanmonstar/reqwest#requirements ) in order to enable sending HTTPS
2424requests to the SendGrid API.
2525
2626## Features
2727You can take advantage of a couple features for the crate. To enable the blocking send function, you
28- can use the ` blocking ` flag. To enable the [ rustls ] ( https://github.com/rustls/rustls ) TLS feature ,
29- use the ` rustls ` flag .
28+ can use the ` blocking ` flag. To use your operating system's [ TLS implementation ] ( https://github.com/sfackler/rust-native-tls ) ,
29+ enable the ` native-tls ` feature .
3030
3131## Example
3232An example of using this library can be found in the examples directory. This example code expects to
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ impl SGClient {
8080 /// RustTLS backend, this can never panic because RustTLS is statically linked.
8181 pub fn new < S : Into < String > > ( key : S ) -> SGClient {
8282 let async_builder = reqwest:: ClientBuilder :: new ( ) ;
83- #[ cfg( feature = "rustls " ) ]
84- let async_builder = async_builder. use_rustls_tls ( ) ;
83+ #[ cfg( feature = "native-tls " ) ]
84+ let async_builder = async_builder. tls_backend_native ( ) ;
8585 let client = async_builder. build ( ) . unwrap ( ) ;
8686
8787 #[ cfg( feature = "blocking" ) ]
@@ -90,8 +90,8 @@ impl SGClient {
9090 #[ cfg( feature = "blocking" ) ]
9191 {
9292 let blocking_builder = reqwest:: blocking:: ClientBuilder :: new ( ) ;
93- #[ cfg( feature = "rustls " ) ]
94- let blocking_builder = blocking_builder. use_rustls_tls ( ) ;
93+ #[ cfg( feature = "native-tls " ) ]
94+ let blocking_builder = blocking_builder. tls_backend_native ( ) ;
9595 blocking_client = blocking_builder. build ( ) . unwrap ( ) ;
9696 }
9797
Original file line number Diff line number Diff line change 2020//!
2121//! # Features
2222//! The projects has the following feature flags:
23- //! * `rustls`: this feature flag switches the default SSL provider in the operating system (usually
24- //! OpenSSL) with RusTLS, which is a TLS implementation in Rust.
25- //! * `native-tls`: enabled by default, this feature flag enabled the default SSL provider in the
26- //! operating system (usually OpenSSL).
23+ //! * `native-tls`: disabled by default, this feature flag enables the default SSL provider in the
24+ //! operating system.
2725//! * `blocking`: this feature flag allows you to construct a synchronous `SGClient`.
2826//!
2927//! ## Build Dependencies
30- //! This library utilises [reqwest](https://crates.io/crates/reqwest). Follow the instructions on
28+ //! This library utilizes [reqwest](https://crates.io/crates/reqwest). Follow the instructions on
3129//! the [reqwest README](https://github.com/seanmonstar/reqwest#requirements) in order to enable
3230//! sending HTTPS requests to the SendGrid API.
3331//!
Original file line number Diff line number Diff line change @@ -3,16 +3,35 @@ use reqwest::{Client, ClientBuilder};
33use crate :: v3:: Sender ;
44
55pub ( crate ) fn new_client ( api_key : & str ) -> Client {
6- ClientBuilder :: new ( )
6+ #[ cfg( feature = "native-tls" ) ]
7+ let c = ClientBuilder :: new ( )
78 . default_headers ( Sender :: get_headers ( api_key) . unwrap_or_default ( ) )
9+ . tls_backend_native ( )
810 . build ( )
9- . unwrap_or_default ( )
11+ . unwrap_or_default ( ) ;
12+
13+ #[ cfg( not( feature = "native-tls" ) ) ]
14+ let c = ClientBuilder :: new ( )
15+ . default_headers ( Sender :: get_headers ( api_key) . unwrap_or_default ( ) )
16+ . build ( )
17+ . unwrap_or_default ( ) ;
18+ c
1019}
1120
1221#[ cfg( feature = "blocking" ) ]
1322pub ( crate ) fn new_blocking_client ( api_key : & str ) -> reqwest:: blocking:: Client {
14- reqwest:: blocking:: ClientBuilder :: new ( )
23+ #[ cfg( feature = "native-tls" ) ]
24+ let c = reqwest:: blocking:: ClientBuilder :: new ( )
1525 . default_headers ( Sender :: get_headers ( api_key) . unwrap_or_default ( ) )
26+ . tls_backend_native ( )
1627 . build ( )
17- . unwrap_or_default ( )
28+ . unwrap_or_default ( ) ;
29+
30+ #[ cfg( not( feature = "native-tls" ) ) ]
31+ let c = reqwest:: blocking:: ClientBuilder :: new ( )
32+ . default_headers ( Sender :: get_headers ( api_key) . unwrap_or_default ( ) )
33+ . build ( )
34+ . unwrap_or_default ( ) ;
35+
36+ c
1837}
You can’t perform that action at this time.
0 commit comments