Registry / networking / tokio-native-tls

tokio-native-tls

JSON →
library0.3.1rscratesunverified

An implementation of TLS/SSL streams for Tokio using native-tls for nonblocking I/O.

# Cargo.toml [dependencies] tokio-native-tls = "0.3.1"
INSTALL
IMPORT
SIG · TOKIO-NATIVE-TLS
T
tokio-native-tls
networkingrustv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TlsConnector
use tokio_native_tls::TlsConnector;

Create a TLS connection to example.com using Tokio and native-tls.

use tokio_native_tls::TlsConnector; use native_tls::TlsConnector as NativeTlsConnector; #[tokio::main] async fn main() { let connector = TlsConnector::from(NativeTlsConnector::new().unwrap()); let stream = tokio::net::TcpStream::connect("example.com:443").await.unwrap(); let tls_stream = connector.connect("example.com", stream).await.unwrap(); println!("TLS connection established"); }
Debug
Known issues
gotchaRequires Tokio runtime to be active.
fix
Use #[tokio::main] or manually create a Tokio runtime.
affects: >=0.3.0
Upgrade
Version history
0.3.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
Resources
tokio-native-tls — cargo add tokio-native-tls · libregistry