Skip to content

feat: Add grpc TLS support#128

Closed
salrashid123 wants to merge 1 commit intocontainers:mainfrom
salrashid123:grpctls
Closed

feat: Add grpc TLS support#128
salrashid123 wants to merge 1 commit intocontainers:mainfrom
salrashid123:grpctls

Conversation

@salrashid123
Copy link

@salrashid123 salrashid123 commented Mar 24, 2026

Fixes #127

This PR introduces TLS support for the grpc key provider.

Specifically, it allows for users to configure the RootCA to trust, the ServerName for the remote host and any client certificates to use when contacting the grpc key provider.

The configuration introduces an optinoal struct with key grpc-tls which when specified will load and use the configuration values

  • root-ca-file: this is the PEM x509 rootCA which issued the grpc server certificate (default: system root CA bundle)
  • insecure-skip-verify: this bypasses TLS validation of the remote grpc server's cert (default false)
  • server-name: specifies the SNI value for the grpc server to use (default, the hostname specified in the grpc parameter)
  • cert-file: client certificate x509 cert to use (PEM format)
  • key-file: client certificate key to use (PEM format)

specifically, a sample ocicrypt could look like

{
  "key-providers": {
    "grpc-keyprovider": {
      "grpc": "your_grpc_keyprovider.domain.com:port",
      "grpc-tls": {
        "server-name": "your_grpc_keyprovider.domain.com",
        "insecure-skip-verify": false,
        "cert-file": "/path/to/client.crt",
        "key-file":"/path/to/client.key",
        "root-ca-file": "/path/to/root-ca.crt"
      }
    }
  }
}

Note, the PR adds a the config to the test case but its not actually invoked

Specifically, it allows for users to configure the RootCA to trust, the ServerName for the remote host and any client certificates to use when contacting the grpc key provider.

The configuration introduces an optinoal struct with key `grpc-tls` which when specified will load and use the configuration values

* `root-ca-file`:  this is the PEM x509 rootCA which issued the grpc server certificate (default: system root CA bundle)
* `insecure-skip-verify`:  this bypasses TLS validation of the remote grpc server's cert (default false)
* `server-name`: specifies the SNI value for the grpc server to use (default, the hostname specified in the `grpc` parameter)
* `cert-file`:  client certificate x509 cert to use (PEM format)
* `key-file`:  client certificate key to use (PEM format)

specifically, a sample ocicrypt could look like

```json
{
  "key-providers": {
    "grpc-keyprovider": {
      "grpc": "your_grpc_keyprovider.domain.com:port",
      "grpc-tls": {
        "server-name": "your_grpc_keyprovider.domain.com",
        "insecure-skip-verify": false,
        "cert-file": "/path/to/client.crt",
        "key-file":"/path/to/client.key",
        "root-ca-file": "/path/to/root-ca.crt"
      }
    }
  }
}
```

Signed-off-by: sal rashid <salrashid123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support grpc provider TLS

2 participants