Fixed error messages

This commit is contained in:
zonyitoo
2020-06-01 00:09:27 +08:00
parent a26ef6a8da
commit f9ed9d35ea
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -885,7 +885,10 @@ pub async fn run(context: SharedContext) -> io::Result<()> {
return Err(Error::new(ErrorKind::Other, err));
}
}
_ => unreachable!("http_local::run shouldn't used with {:?}", context.config().config_type),
_ => unreachable!(
"http_local::run shouldn't be used with {:?}",
context.config().config_type
),
}
Ok(())
+2 -2
View File
@@ -71,7 +71,7 @@ impl TlsAcceptor {
let err = io::Error::new(io::ErrorKind::Other, format!("setting certificate: {}", err));
return Err(err);
}
config.set_protocols(&["h2".into(), "http/1.1".into()]);
// config.set_protocols(&["h2".into(), "http/1.1".into()]);
let server_config = Arc::new(config);
@@ -101,7 +101,7 @@ impl TlsAcceptor {
match rustls::internal::pemfile::rsa_private_keys(&mut BufReader::new(key)) {
Ok(pk) => Ok(pk),
Err(..) => {
let err = io::Error::new(io::ErrorKind::InvalidData, "error while loading PKCS #8 private keys");
let err = io::Error::new(io::ErrorKind::InvalidData, "error while loading RSA private keys");
Err(err)
}
}