From the course: gRPC in Python

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Using HTTPS

Using HTTPS

- GRPC uses HTP two as a transport layer. By default HTP two uses HTPS or TLS to encrypt all the traffic. It makes sure that no one can watch the data that is running on the network. It is easy to get certificates using services such as Let's Encrypt. For development purposes we are going to use the OpenSSL framework to generate development key files. You need to install it using your package manager. I wrote a script to generate the keys. I will not go into all the commands that are on how to generate the keys. Let's run it. And this generated two new files, key.pem and cert.pem. And now we can use them when creating a server. I wrote a function called load_credentials. It goes going to open the file for the certificate file and read the content. Do the same for the key file and return grpc.ssl_server_credentials from the key and the certificate. Now when we create the server we load the credential and we add…

Contents