mirror of
https://github.com/Noratrieb/tls.git
synced 2026-01-16 01:25:02 +01:00
more
This commit is contained in:
parent
5429fb2e7c
commit
6eb89b926c
2 changed files with 169 additions and 51 deletions
13
src/lib.rs
13
src/lib.rs
|
|
@ -1,10 +1,13 @@
|
|||
pub mod proto;
|
||||
|
||||
use std::{
|
||||
io::{self, Read},
|
||||
fmt::Debug,
|
||||
io::{self},
|
||||
net::{TcpStream, ToSocketAddrs},
|
||||
};
|
||||
|
||||
use crate::proto::CipherSuite;
|
||||
|
||||
type Result<T, E = Error> = std::result::Result<T, E>;
|
||||
|
||||
pub struct ClientConnection {}
|
||||
|
|
@ -26,9 +29,9 @@ impl ClientSetupConnection {
|
|||
legacy_version: proto::LEGACY_VERSION,
|
||||
random: rand::random(),
|
||||
legacy_session_id: 0,
|
||||
cipher_suites: [0; 2],
|
||||
cipher_suites: vec![CipherSuite::TlsAes128GcmSha256].into(),
|
||||
legacy_compressions_methods: 0,
|
||||
extensions: 0,
|
||||
extensions: vec![].into(),
|
||||
};
|
||||
proto::write_handshake(&mut stream, handshake)?;
|
||||
|
||||
|
|
@ -41,12 +44,12 @@ impl ClientSetupConnection {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct Error {
|
||||
kind: ErrorKind,
|
||||
pub kind: ErrorKind,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ErrorKind {
|
||||
InvalidHandshake(u8),
|
||||
InvalidHandshake(Box<dyn Debug>),
|
||||
Io(io::Error),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue