* 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 makes it so you can check if the initial connection
is established. Before this we used reconnect which would
lazily attempt to connect. So if you were trying to connect
to a non existant Server you wouldn't find out until after
you attempted your first RPC. This simplifies everything
by allowing you connect before creating the RPC client.
BREAKING CHANGE: `Endpoint::channel` was removed in favor of
an async `Endpoint::connect`.
* feat(transport): Add service multiplexing/routing
This change introduces a new "router" built on top of
`transport::Server` that allows one to run multiple
gRPC services on the same socket.
```rust
Server::builder()
.add_service(greeter)
.add_service(echo)
.serve(addr)
.await?;
```
There is also a new `multiplex` example showcasing
server side service multiplexing and client side
service multiplexing.
BREAKING CHANGES: `Server::serve` is now crate private
and all services must be added via `Server::add_service`.
Codegen also returns just a `Service` now instead of a
`MakeService` pair.
Closes#29
Signed-off-by: Lucio Franco [email protected]
This commit reworks TLS configuration of both servers and endpoints in
order to provide a more flexible API. We now add options to configure
the selected TLS library using the appropriate 'native' configuration
structures, as well as retaining the existing simplier interface which
is compatible with both.
The new API can also be easily extended to support simple interfaces for
configuring mTLS and a range of other options without creating sprawl
in the builders for `Server` and `Endpoint`.