diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-06-11 18:35:00 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-06-11 18:35:00 +0200 |
| commit | 24ab81363b18f874c68690ae54ba8a27bd46acd3 (patch) | |
| tree | 4b888aba76db7759f85ff97d8772006a0ae8580c /mumctl | |
| parent | 589560ae3a7ae7a46f4cdfe814393bda261fa53f (diff) | |
| download | mum-24ab81363b18f874c68690ae54ba8a27bd46acd3.tar.gz | |
servert cert reject is error
Diffstat (limited to 'mumctl')
| -rw-r--r-- | mumctl/src/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index 9de946e..bf1ffdc 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -272,15 +272,15 @@ fn match_opt() -> Result<(), Error> { username: username.to_string(), password: password.map(|x| x.to_string()), accept_invalid_cert: cli_accept_invalid_cert || config_accept_invalid_cert.unwrap_or(false), - })??; + })?; match response { - Some(CommandResponse::ServerConnect { welcome_message }) => { + Ok(Some(CommandResponse::ServerConnect { welcome_message })) => { println!("Connected to {}", host); if let Some(message) = welcome_message { println!("Welcome: {}", message); } } - Some(CommandResponse::ServerCertReject) => { + Err(mumlib::error::Error::ServerCertReject) => { error!("Connection rejected since the server supplied an invalid certificate."); if !specified_accept_invalid_cert { eprintln!("help: If you trust this server anyway, you can do any of the following to connect:"); @@ -289,7 +289,8 @@ fn match_opt() -> Result<(), Error> { eprintln!(" 3. Permantently trust all invalid certificates by setting accept_all_invalid_certs=true globally"); } } - other => unreachable!("Response should only be a ServerConnect or ServerCertReject. Got {:?}", other) + Ok(other) => unreachable!("Response should only be a ServerConnect or ServerCertReject. Got {:?}", other), + Err(e) => return Err(e.into()), } } Command::Disconnect => { |
