Skip to content

Commit dd2c885

Browse files
nickbplink2xt
authored andcommitted
Configure rust-native-tls to include ALPN support, expose ALPN option
1 parent 7aaa315 commit dd2c885

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ categories = ["asynchronous", "cryptography", "network-programming"]
1515

1616

1717
[dependencies]
18-
native-tls = "0.2.8"
18+
native-tls = { version = "0.2.8", features = ["alpn"] }
1919
thiserror = "1.0.9"
2020
futures-util = { version = "0.3.1", features = ["io"], optional = true }
2121
tokio = { version = "1.0", default-features = false, features = ["io-util"], optional = true }

src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ mod connect {
273273
self
274274
}
275275

276+
/// Request specific protocols through ALPN (Application-Layer Protocol Negotiation).
277+
///
278+
/// Defaults to none
279+
pub fn request_alpns(mut self, protocols: &[&str]) -> Self {
280+
self.builder.request_alpns(protocols);
281+
self
282+
}
283+
276284
/// Controls the use of certificate validation.
277285
///
278286
/// Defaults to false.

0 commit comments

Comments
 (0)