Use rustls for interop tests (#125)

* Use rustls for interop tests

This commit changes the interop tests to use rustls instead of openssl.
Apparently in the past there was some issue with this, but it seems to
work OK to me.

* Use certificates with larger key sizes for interop

This commit switches out the certificates used for testing interop to be
based on 4096-bit RSA keys, allowing rustls to be used for the interop
testing instead of OpenSSL.

The keys are generated using Terraform, although the state file is not
committed. A README.md is added to the data directory that explains how
to use Terraform to rotate the test certificates if this is ever
desirable.

This is desirable in order that none of the crates which `cargo build
--all` will build have the `openssl` feature, which should allow Tonic
to build on Windows with no issues.
This commit is contained in:
James Nugent
2019-11-09 17:00:23 +00:00
committed by Lucio Franco
parent ac0e333b39
commit ed53be5779
10 changed files with 153 additions and 46 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let ca = Certificate::from_pem(pem);
endpoint.tls_config(
ClientTlsConfig::with_openssl()
ClientTlsConfig::with_rustls()
.ca_certificate(ca)
.domain_name("foo.test.google.fr"),
);
+1 -1
View File
@@ -26,7 +26,7 @@ async fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
let key = tokio::fs::read("tonic-interop/data/server1.key").await?;
let identity = Identity::from_pem(cert, key);
builder.tls_config(ServerTlsConfig::with_openssl().identity(identity));
builder.tls_config(ServerTlsConfig::with_rustls().identity(identity));
}
builder.interceptor_fn(|svc, req| {