Add new test for client configuration
This commit is contained in:
@ -7,6 +7,7 @@ use std::sync::Arc;
|
||||
use futures::future::join_all;
|
||||
use reqwest::{Certificate, Identity};
|
||||
|
||||
use crate::base::err_utils::new_err;
|
||||
use crate::base::RemoteConfig;
|
||||
use crate::tcp_relay_client::client_config::ClientConfig;
|
||||
use crate::tcp_relay_client::relay_client::relay_client;
|
||||
@ -54,15 +55,14 @@ async fn get_server_config(conf: &ClientConfig) -> Result<RemoteConfig, Box<dyn
|
||||
|
||||
/// Core logic of the application
|
||||
pub async fn run_app(mut args: ClientConfig) -> std::io::Result<()> {
|
||||
args.load_certificates();
|
||||
args.load_certificates()?;
|
||||
let args = Arc::new(args);
|
||||
|
||||
// Check arguments coherence
|
||||
if args.tls_cert.is_some() != args.tls_key.is_some() {
|
||||
log::error!(
|
||||
"If you specify one of TLS certificate / key, you must then specify the other!"
|
||||
);
|
||||
panic!();
|
||||
return Err(new_err(
|
||||
"If you specify one of TLS certificate / key, you must then specify the other!",
|
||||
));
|
||||
}
|
||||
|
||||
if args.get_client_keypair().is_some() {
|
||||
|
Reference in New Issue
Block a user