Skip to content

Commit

Permalink
chore(interop): Remove unnecessary asyncronous file io to read data (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Mar 31, 2023
1 parent ff33119 commit 44ccf49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion interop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ http = "0.2"
http-body = "0.4.2"
hyper = "0.14"
prost = "0.11"
tokio = {version = "1.0", features = ["rt-multi-thread", "time", "macros", "fs"]}
tokio = {version = "1.0", features = ["rt-multi-thread", "time", "macros"]}
tokio-stream = "0.1"
tonic = {path = "../tonic", features = ["tls"]}
tower = {version = "0.4"}
Expand Down
2 changes: 1 addition & 1 deletion interop/src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.concurrency_limit(30);

if matches.use_tls {
let pem = tokio::fs::read("interop/data/ca.pem").await?;
let pem = std::fs::read_to_string("interop/data/ca.pem")?;
let ca = Certificate::from_pem(pem);
endpoint = endpoint.tls_config(
ClientTlsConfig::new()
Expand Down
4 changes: 2 additions & 2 deletions interop/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
let mut builder = Server::builder();

if matches.use_tls {
let cert = tokio::fs::read("interop/data/server1.pem").await?;
let key = tokio::fs::read("interop/data/server1.key").await?;
let cert = std::fs::read_to_string("interop/data/server1.pem")?;
let key = std::fs::read_to_string("interop/data/server1.key")?;
let identity = Identity::from_pem(cert, key);

builder = builder.tls_config(ServerTlsConfig::new().identity(identity))?;
Expand Down

0 comments on commit 44ccf49

Please sign in to comment.