feat: remove openssl transitive dependency

This commit is contained in:
Paul Campbell 2025-01-18 20:52:20 +00:00
parent 3f87d011e7
commit db523065e0
4 changed files with 2 additions and 20 deletions

View file

@ -1,10 +1,8 @@
//
mod kxio;
mod tls;
fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Hello, world!");
tls::main();
let rt = tokio::runtime::Runtime::new()?;
Ok(rt.block_on(crate::kxio::main())?)

View file

@ -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));
}