mirror of
https://github.com/Noratrieb/tls.git
synced 2026-01-14 16:45:02 +01:00
cleanup
This commit is contained in:
parent
a81438e7e3
commit
8f212576e5
3 changed files with 374 additions and 355 deletions
13
src/lib.rs
13
src/lib.rs
|
|
@ -3,9 +3,11 @@ pub mod proto;
|
|||
use std::{
|
||||
fmt::Debug,
|
||||
io::{self, BufWriter, Read, Write},
|
||||
net::{TcpStream, ToSocketAddrs},
|
||||
net::TcpStream,
|
||||
};
|
||||
|
||||
use crate::proto::TLSPlaintext;
|
||||
|
||||
type Result<T, E = Error> = std::result::Result<T, E>;
|
||||
|
||||
pub struct ClientConnection {}
|
||||
|
|
@ -54,7 +56,12 @@ impl ClientSetupConnection {
|
|||
|
||||
println!("hello!");
|
||||
let out = proto::TLSPlaintext::read(stream.get_mut())?;
|
||||
dbg!(out);
|
||||
dbg!(&out);
|
||||
|
||||
if matches!(out, TLSPlaintext::Handshake { handshake } if handshake.is_hello_retry_request())
|
||||
{
|
||||
println!("hello retry request, the server doesnt like us :(");
|
||||
}
|
||||
|
||||
// let res: proto::TLSPlaintext = proto::Value::read(&mut stream.get_mut())?;
|
||||
// dbg!(res);
|
||||
|
|
@ -76,7 +83,6 @@ pub enum ErrorKind {
|
|||
|
||||
impl From<io::Error> for Error {
|
||||
fn from(value: io::Error) -> Self {
|
||||
panic!("io error: {value}");
|
||||
Self {
|
||||
kind: ErrorKind::Io(value),
|
||||
}
|
||||
|
|
@ -85,7 +91,6 @@ impl From<io::Error> for Error {
|
|||
|
||||
impl From<ErrorKind> for Error {
|
||||
fn from(value: ErrorKind) -> Self {
|
||||
panic!("error: {value:?}");
|
||||
Self { kind: value }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue