Skip to content

Commit 8a26a74

Browse files
committed
say server.key not key.pem in 'start' cmd's help
it's less confusing to align with the file naming from spacetimedb-cert-gen repo
1 parent d0c7f12 commit 8a26a74

File tree

1 file changed

+5
-2
lines changed
  • crates/standalone/src/subcommands

1 file changed

+5
-2
lines changed

crates/standalone/src/subcommands/start.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ pub fn cli() -> clap::Command {
7272
.requires("ssl")
7373
.help("--cert server.crt: The server sends this to clients during the TLS handshake. ie. server's public key, which if it's self-signed then this is the file that you pass to clients via --cert when talking to the server from a client(or the cli), or if signed by a local CA then pass that CA's pub cert to your clients instead, in order to can trust this server from a client connection. Otherwise, you don't have to pass anything to clients if this cert was signed by a public CA like Let's Encrypt.")
7474
)
75-
.arg(Arg::new("key").long("key").requires("ssl").value_name("FILE").help("--key key.pem: The server keeps this private to decrypt and sign responses. ie. the server's private key"))
75+
.arg(Arg::new("key").long("key").requires("ssl").value_name("FILE")
76+
.action(clap::ArgAction::Set)
77+
.value_parser(clap::value_parser!(std::path::PathBuf))
78+
.help("--key server.key: The server keeps this private to decrypt and sign responses. ie. the server's private key"))
7679
// .after_help("Run `spacetime help start` for more detailed information.")
7780
}
7881

@@ -154,7 +157,7 @@ pub async fn exec(args: &ArgMatches) -> anyhow::Result<()> {
154157
if args.get_flag("ssl") {
155158
use std::path::{Path, PathBuf};
156159
let cert_path: &Path = args.get_one::<PathBuf>("cert").context("Missing --cert for SSL")?.as_path();
157-
let key_path = args.get_one::<String>("key").context("Missing --key for SSL")?;
160+
let key_path: &Path = args.get_one::<PathBuf>("key").context("Missing --key for SSL")?.as_path();
158161
// Install the default CryptoProvider at the start of the function
159162
// This only needs to happen once per process, so it's safe to call here
160163
use rustls::crypto::ring::default_provider;

0 commit comments

Comments
 (0)