Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/klutzy/suruga
[INACTIVE] TLS 1.2 implementation in Rust
https://github.com/klutzy/suruga
Last synced: 7 days ago
JSON representation
[INACTIVE] TLS 1.2 implementation in Rust
- Host: GitHub
- URL: https://github.com/klutzy/suruga
- Owner: klutzy
- License: mit
- Created: 2014-06-15T14:00:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-01-19T01:29:04.000Z (almost 9 years ago)
- Last Synced: 2024-08-01T03:28:21.166Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 169 KB
- Stars: 124
- Watchers: 14
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-cn - klutzy/suruga
- awesome-rust - klutzy/suruga
- awesome-rust - seb-m/common.rs
- awesome-rust - klutzy/suruga
- awesome-rust-cn - klutzy/suruga
- awesome-rust-zh - klutzy/suruga - Rust 的一个实现[TLS 1.2](https://tools.ietf.org/html/rfc5246) (库 / 加密)
- awesome-rust - klutzy/suruga - Implementation of [TLS 1.2](https://datatracker.ietf.org/doc/html/rfc5246) (Libraries / Cryptography)
- awesome-rust - klutzy/suruga
- fucking-awesome-rust - klutzy/suruga - Implementation of 🌎 [TLS 1.2](datatracker.ietf.org/doc/html/rfc5246) (Libraries / Cryptography)
- fucking-awesome-rust - klutzy/suruga - Implementation of 🌎 [TLS 1.2](datatracker.ietf.org/doc/html/rfc5246) (Libraries / Cryptography)
README
suruga is Rust implementation of [TLS 1.2][tls-12].
It currently implements some core parts of TLS 1.2,
NIST P-256 [ECDHE][tls-ecc] and [chacha20-poly1305][tls-chacha20-poly1305].# Usage
```Rust
extern crate suruga;use std::io::prelude::*;
use std::net::TcpStream;fn main() {
test().unwrap();
}fn test() -> suruga::tls_result::TlsResult<()> {
let stream = try!(TcpStream::connect("www.google.com:443"));
let mut client = try!(suruga::TlsClient::from_tcp(stream));
let _len = try!(client.write(b"GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n"));let mut msg = vec![0u8; 100];
try!(client.read(&mut msg));
let msg = String::from_utf8_lossy(&msg);
println!("msg: {}", msg);try!(client.close());
Ok(())
}
```[tls-12]: http://tools.ietf.org/html/rfc5246
[tls-ecc]: http://tools.ietf.org/html/rfc4492
[tls-chacha20-poly1305]: https://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04