mirror of
https://github.com/php-win-ext/grpc.git
synced 2026-03-24 09:02:15 +01:00
gRPC is currently getting formatted with two different clang-format implementations, and due to some weirdness they have different include file orderings. This change introduces clang-format configuration to ensure that the two systems align - it's *highly* expected that this will need some maintenance going forward as the two systems evolve. Closes #40905 PiperOrigin-RevId: 819606209
Authentication Example
Overview
SSL is a commonly used cryptographic protocol to provide end-to-end communication security. In the example, we show how to set up a server authenticated SSL connection to transmit RPC.
We provide grpc::SslServerCredentials and grpc::SslCredentials types
to use SSL connections.
In our example, we use the public/private keys created ahead:
- "localhost.crt" contains the server certificate (public key).
- "localhost.key" contains the server private key.
- "root.crt" contains the certificate (certificate authority) that can verify the server's certificate.
Try it!
Once you have working gRPC, you can build this example using either bazel or cmake. Make sure to run those at this directory so that they can read credential files properly.
Run the server, which will listen on port 50051:
$ ./ssl_server
Run the client (in a different terminal):
$ ./ssl_client
If things go smoothly, you will see the client output:
Greeter received: Hello world