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
@@ -0,0 +1,3 @@
.terraform/
*.tfstate
*.tfstate.backup
+27
View File
@@ -0,0 +1,27 @@
resource "tls_private_key" "root" {
algorithm = "RSA"
rsa_bits = "2048"
}
resource "tls_self_signed_cert" "root" {
key_algorithm = tls_private_key.root.algorithm
private_key_pem = tls_private_key.root.private_key_pem
validity_period_hours = 87600
early_renewal_hours = 8760
is_ca_certificate = true
allowed_uses = ["cert_signing"]
subject {
common_name = "Tonic Testing CA"
organization = "Tokio"
organizational_unit = "Testing"
}
}
resource "local_file" "ca_cert" {
filename = "../ca.pem"
content = tls_self_signed_cert.root.cert_pem
}
@@ -0,0 +1,40 @@
resource "tls_private_key" "server" {
algorithm = "RSA"
rsa_bits = "2048"
}
resource "tls_cert_request" "server" {
key_algorithm = tls_private_key.server.algorithm
private_key_pem = tls_private_key.server.private_key_pem
subject {
common_name = "Tonic Test Server Cert"
}
dns_names = [
"*.test.google.fr",
]
}
resource "tls_locally_signed_cert" "server" {
cert_request_pem = tls_cert_request.server.cert_request_pem
ca_key_algorithm = tls_private_key.root.algorithm
ca_private_key_pem = tls_private_key.root.private_key_pem
ca_cert_pem = tls_self_signed_cert.root.cert_pem
validity_period_hours = 43800
early_renewal_hours = 8760
allowed_uses = ["server_auth"]
}
resource "local_file" "server_cert" {
filename = "../server1.pem"
content = tls_locally_signed_cert.server.cert_pem
}
resource "local_file" "server_key" {
filename = "../server1.key"
content = tls_private_key.server.private_key_pem
}