diff --git a/Cargo.toml b/Cargo.toml index 41fa947..4b31261 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,5 @@ version = "0.1.0" edition = "2021" [dependencies] -kxio = "5.0" -native-tls = { version = "0.2", features = ["vendored"] } +kxio = "5.1" tokio = { version = "1.43", features = ["full"] } diff --git a/justfile b/justfile index 223b3a8..60bdbb1 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -image := "git.kemitix.get/kemitix/rust:test" +image := "git.kemitix.net/kemitix/rust:test" build: docker build . -t {{ image }} diff --git a/src/main.rs b/src/main.rs index 341c44b..93488b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,8 @@ // mod kxio; -mod tls; fn main() -> Result<(), Box> { println!("Hello, world!"); - tls::main(); let rt = tokio::runtime::Runtime::new()?; Ok(rt.block_on(crate::kxio::main())?) diff --git a/src/tls.rs b/src/tls.rs deleted file mode 100644 index f4cb49c..0000000 --- a/src/tls.rs +++ /dev/null @@ -1,15 +0,0 @@ -use native_tls::TlsConnector; -use std::io::{Read, Write}; -use std::net::TcpStream; - -pub fn main() { - let connector = TlsConnector::new().unwrap(); - - let stream = TcpStream::connect("google.com:443").unwrap(); - let mut stream = connector.connect("google.com", stream).unwrap(); - - stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap(); - let mut res = vec![]; - stream.read_to_end(&mut res).unwrap(); - println!("{}", String::from_utf8_lossy(&res)); -}