fix P2 and P4 to use the default cert path and print the client port for easier testing

main
_ 2021-10-10 16:23:21 +00:00
parent 2b60396a26
commit fc6a9c9e1e
2 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ async fn main () -> anyhow::Result <()> {
let opt = Opt::from_args (); let opt = Opt::from_args ();
let server_cert = tokio::fs::read ("quic_server.crt").await?; let server_cert = tokio::fs::read ("ptth_quic_output/quic_server.crt").await?;
let relay_addr = opt.relay_addr.unwrap_or_else (|| String::from ("127.0.0.1:30380")).parse ()?; let relay_addr = opt.relay_addr.unwrap_or_else (|| String::from ("127.0.0.1:30380")).parse ()?;
let endpoint = make_client_endpoint ("0.0.0.0:0".parse ()?, &[&server_cert])?; let endpoint = make_client_endpoint ("0.0.0.0:0".parse ()?, &[&server_cert])?;
@ -83,7 +83,7 @@ async fn main () -> anyhow::Result <()> {
Ok::<_, anyhow::Error> (()) Ok::<_, anyhow::Error> (())
}); });
debug! ("Accepting local TCP connections from P1"); debug! ("Accepting local TCP connections from P1 at {}", client_tcp_port);
task_tcp_server.await??; task_tcp_server.await??;

View File

@ -74,7 +74,7 @@ impl Opt {
let relay_cert: Vec <u8> = match self.cert_url.as_ref () { let relay_cert: Vec <u8> = match self.cert_url.as_ref () {
Some (url) => reqwest::get (url).await?.bytes ().await?.into_iter ().collect (), Some (url) => reqwest::get (url).await?.bytes ().await?.into_iter ().collect (),
None => tokio::fs::read ("quic_server.crt").await?, None => tokio::fs::read ("ptth_quic_output/quic_server.crt").await?,
}; };
Ok (Config { Ok (Config {