Skip to content

feat: Add grpc TLS support#129

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

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

Conversation

@salrashid123
Copy link
Copy Markdown
Contributor

This Commit PR introduces TLS support for the grpc key provider.

fixes #127

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"
      }
    }
  }
}

@salrashid123
Copy link
Copy Markdown
Contributor Author

@stefanberger allright, i'll give it another try. hopefully there's no squash needed here

@stefanberger
Copy link
Copy Markdown
Collaborator

LGTM. @lumjjb ?

This Commit 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

```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>

update variable location

Signed-off-by: sal rashid <salrashid123@gmail.com>
@salrashid123
Copy link
Copy Markdown
Contributor Author

@stefanberger i think i got the squash stuff ready with the last command . Should be ready to merge afaik

@stefanberger
Copy link
Copy Markdown
Collaborator

I merged it now with some editing of the commit text.

@stefanberger
Copy link
Copy Markdown
Collaborator

Thanks!

@salrashid123 salrashid123 deleted the grpctls branch March 30, 2026 14:05
@lumjjb
Copy link
Copy Markdown
Collaborator

lumjjb commented Mar 30, 2026

Yep LGTM! :)

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

3 participants