tidy-up tls cargo & use

This commit is contained in:
nworbnhoj 2023-06-26 08:12:11 +10:00
parent 21961ad756
commit a741e7988b
4 changed files with 40 additions and 27 deletions

View file

@ -20,5 +20,5 @@ net = { path = "../../services/net" }
pddb = { path = "../../services/pddb" }
rkyv = "0.4.3"
rustls = "0.21.2"
rustls = { version = "0.21.2", features = ["dangerous_configuration"]}
x509-parser = "0.15.0"

View file

@ -7,7 +7,7 @@ use rkyv::{
AlignedVec, Archive, Deserialize, Serialize,
};
use rustls::{Certificate, DistinguishedName, RootCertStore};
use std::convert::TryFrom;
use std::cmp::min;
use std::convert::{Into, TryFrom};
use std::fs::File;
use std::io::{Error, ErrorKind, Read, Write};

View file

@ -76,12 +76,19 @@ tracing-subscriber = {version = "0.3.11", optional = true}
# for rustls testing
tls = {path="../../libs/tls"}
rustls = {version = "0.21.2", optional = true} # note requirement for patch to xous-ring in workspace Cargo.toml
# rustls = {path="../../../rustls/rustls"}
# note requirement for patch to xous-ring in workspace Cargo.toml
rustls = {version = "0.21.2", optional = true}
webpki-roots = {version = "0.22.4", optional = true}
ring = {version = "0.16.20", optional = true} # for testing ring math functions # note requirement for patch to xous-ring in workspace Cargo.toml
tungstenite = {version = "0.17.3", optional = true, features = ["rustls-tls-webpki-roots"]}
url = {version = "2.2.2", optional = true}
x509-parser = "0.15.0"
# for testing ring math functions
# note requirement for patch to xous-ring in workspace Cargo.toml
ring = {version = "0.16.20", optional = true}
# for websocket testing
tungstenite = {version = "0.17.3", optional = true, features = ["rustls-tls-webpki-roots"]}
# for performance testing
perflib = {path="../../tools/perflib", optional = true}

View file

@ -1,30 +1,36 @@
use crate::{ShellCmdApi, CommonEnv};
use crate::{CommonEnv, ShellCmdApi};
use com::api::NET_MTU;
use xous_ipc::String;
#[cfg(any(feature="precursor", feature="renode"))]
use net::XousServerId;
use net::NetPingCallback;
use xous::MessageEnvelope;
use num_traits::*;
use std::net::{IpAddr, TcpStream, TcpListener};
use std::io::Write;
#[cfg(feature = "tls")]
use rustls::{Certificate, OwnedTrustAnchor};
use rustls::internal::msgs::base::PayloadU16;
use rustls::internal::msgs::handshake::DistinguishedName;
use std::io::Read;
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
use std::thread;
use std::io::Write;
use std::net::{IpAddr, TcpListener, TcpStream};
use std::sync::mpsc;
#[cfg(feature="ditherpunk")]
use std::str::FromStr;
#[cfg(feature="ditherpunk")]
use gam::DecodePng;
#[cfg(feature="tls")]
use std::convert::TryInto;
#[cfg(feature="tls")]
use tungstenite::{WebSocket, stream::MaybeTlsStream};
#[cfg(feature="shellperf")]
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::{Duration, Instant};
use xous::MessageEnvelope;
use xous_ipc::String;
#[cfg(feature = "ditherpunk")]
use {gam::DecodePng, std::str::FromStr};
#[cfg(any(feature = "precursor", feature = "renode"))]
use net::XousServerId;
#[cfg(feature = "shellperf")]
use perflib::*;
#[cfg(feature = "tls")]
use {
rustls::{Certificate, OwnedTrustAnchor},
std::convert::TryInto,
tls::{danger, Trusted},
tungstenite::{stream::MaybeTlsStream, WebSocket},
};
pub struct NetCmd {
callback_id: Option<u32>,
callback_conn: u32,