Skip to content

Commit b78c0eb

Browse files
authored
examples: Update features/encryption/README.md file (#7045)
1 parent c003fdf commit b78c0eb

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

examples/features/encryption/README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Encryption
22

3-
The example for encryption includes two individual examples for TLS and ALTS
4-
encryption mechanism respectively.
3+
The example for encryption includes three individual examples for TLS, ALTS
4+
and mTLS encryption mechanism respectively.
55

66
## Try it
77

@@ -35,7 +35,7 @@ In our example, we use the public/private keys created ahead:
3535
* "ca_cert.pem" contains the certificate (certificate authority)
3636
that can verify the server's certificate.
3737

38-
On server side, we provide the paths to "server.pem" and "server.key" to
38+
On server side, we provide the paths to "server_cert.pem" and "server_key.pem" to
3939
configure TLS and create the server credential using
4040
[`credentials.NewServerTLSFromFile`](https://godoc.org/google.golang.org/grpc/credentials#NewServerTLSFromFile).
4141

@@ -91,16 +91,29 @@ successfully up.
9191
In mutual TLS (mTLS), the client and the server authenticate each other. gRPC
9292
allows users to configure mutual TLS at the connection level.
9393

94+
In this example, we use the following public/private keys created ahead of time:
95+
96+
* "server_cert.pem" contains the server's certificate (public key).
97+
* "server_key.pem" contains the server's private key.
98+
* "ca_cert.pem" contains the certificate of the certificate authority that can
99+
verify the server's certificate.
100+
* "client_cert.pem" contains the client's certificate (public key).
101+
* "client_key.pem" contains the client's private key.
102+
* "client_ca_cert.pem" contains the certificate of the certificate authority
103+
that can verify the client's certificate.
104+
94105
In normal TLS, the server is only concerned with presenting the server
95106
certificate for clients to verify. In mutual TLS, the server also loads in a
96-
list of trusted CA files for verifying client presented certificates with.
97-
This is done via setting
107+
list of trusted CA files for verifying the client's presented certificates.
108+
This is done by setting
98109
[`tls.Config.ClientCAs`](https://pkg.go.dev/crypto/tls#Config.ClientCAs)
99110
to the list of trusted CA files,
100-
and setting [`tls.config.ClientAuth`](https://pkg.go.dev/crypto/tls#Config.ClientAuth)
101-
to [`tls.RequireAndVerifyClientCert`](https://pkg.go.dev/crypto/tls#RequireAndVerifyClientCert).
111+
and setting
112+
[`tls.config.ClientAuth`](https://pkg.go.dev/crypto/tls#Config.ClientAuth)
113+
to
114+
[`tls.RequireAndVerifyClientCert`](https://pkg.go.dev/crypto/tls#RequireAndVerifyClientCert).
102115

103116
In normal TLS, the client is only concerned with authenticating the server by
104117
using one or more trusted CA file. In mutual TLS, the client also presents its
105-
client certificate to the server for authentication. This is done via setting
118+
client certificate to the server for authentication. This is done by setting
106119
[`tls.Config.Certificates`](https://pkg.go.dev/crypto/tls#Config.Certificates).

0 commit comments

Comments
 (0)