Crate libtls [−] [src]
This library crate provides mid-level bindings to the libtls API, provided by OpenBSD's libressl.
Example
use std::io::prelude::*; use libtls::*; let init = Init::init(); let mut config = Config::new(init); config.insecure_noverifycert(); let mut stream = config .connect(("google.com", 443)) .expect("connection failed"); let mut buf = vec![0; 32]; stream.write(&mut buf).expect("write failed"); stream.close().expect("close failed");
Structs
Ciphers |
A list of enabled encryption algorithms. |
Config |
A TLS connection builder. |
Init |
The global TLS context. This object exists to represent the global state
in libtls. Retrieving another instance with |
Protocols |
A list of enabled TLS protocols. Pass this to |
Stream |
A TLS connection. |
Enums
ConnectError |
Errors that can result from running one of the |
Traits
ToNamedSocketAddrs |
This is a variant of |