Skip to content

Commit

Permalink
Print SNI from credentials file. (#1365)
Browse files Browse the repository at this point in the history
* Print SNI from credentials file.

* Update Cargo.lock

* Cargo.lock update
  • Loading branch information
diksipav authored Sep 6, 2024
1 parent 5917f7e commit 5d7d8ce
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
40 changes: 20 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions src/portable/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,30 @@ pub fn show_credentials(options: &Options, c: &ShowCredentials) -> anyhow::Resul
}
Some(url.to_string())
} else {
crate::table::settings(&[
let mut settings = vec![
("Host", creds.host.unwrap_or("localhost".to_string())),
("Port", creds.port.to_string()),
("User", creds.user),
("User", creds.user.clone()),
(
"Password",
creds
.password
.as_ref()
.map(|_| "<hidden>".to_string())
.unwrap_or("<none>".to_string()),
),
(
"Database",
creds.database.unwrap_or("<default>".to_string()),
creds.database.clone().unwrap_or("<default>".to_string()),
),
("TLS Security", format!("{:?}", creds.tls_security)),
]);
];

if let Some(server_name) = creds.tls_server_name {
settings.push(("TLS Server Name", server_name.clone()));
}

crate::table::settings(&settings);
None
} {
stdout()
Expand Down

0 comments on commit 5d7d8ce

Please sign in to comment.