grpc_ssl_certificate_key

The grpc_ssl_certificate_key directive specifies the private key file for the SSL certificate used in gRPC communications.

Syntaxgrpc_ssl_certificate_key path/to/private.key;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The grpc_ssl_certificate_key directive is used to define the private key file necessary for establishing secure gRPC connections. This directive is particularly critical when the server needs to authenticate itself to clients using SSL/TLS. The parameter provided should be the path to a PEM encoded file that contains the private key associated with the SSL certificate defined by the grpc_ssl_certificate directive. When a gRPC client attempts to connect, it will use the SSL certificate and private key to establish a secure connection, ensuring that data transferred is encrypted and secure.

The context in which this directive can be used is at http, server, or location levels. This flexibility allows for granular control of SSL configurations depending on the needs of different parts of the web server. It's important to note that without a valid certificate and corresponding private key specified, clients may not be able to establish a connection, resulting in communication failures. Thus, the proper setting of this directive is essential for gRPC services that demand confidentiality and integrity through SSL/TLS encryption.

Config Example

server {
    listen 443 ssl;
    grpc_ssl_certificate     /etc/ssl/certs/server.crt;
    grpc_ssl_certificate_key /etc/ssl/private/server.key;
}

Ensure that the private key file path is correct and accessible by the NGINX process.

The private key must match the SSL certificate specified by the grpc_ssl_certificate directive.

If the file permissions are too restrictive, NGINX may not be able to read the key file, leading to startup errors.

← Back to all directives