jackc / jackc/pgx

Support inline SSL certificates

Open
#956 8 comments 4 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

pq just added this feature https://github.com/lib/pq/pull/818/files and it would be really nice to have this here because in the containers world certs are usually passed to apps as environment variables.

Now we have to manually compose TLS config:

```go
pair, err := tls.X509KeyPair(cert, key)
if err != nil {
return err
}
config := &tls.Config{
ServerName: serverName,
Certificates: []tls.Certificate{pair},
RootCAs: x509.NewCertPool(),
}
if !config.RootCAs.AppendCertsFromPEM(ca) {
return errors.New("cannot append root CA certificates")
}
poolConfig.ConnConfig.TLSConfig = config
```

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked lib/pq pull request and then locate pgx’s existing TLS configuration entry point. Compare the requested inline certificate, key, and CA handling with the current manual tls.Config example. Done means callers can provide certificate values in the container-oriented form described without assembling that TLS configuration themselves.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.