+
Skip to content

Conversation

elichai
Copy link
Contributor

@elichai elichai commented Oct 10, 2024

PR Info

Currently if you want to use SSL client certificate and key you can currently do it via a few options:

  1. Manually create a PgPool or MySqlPool and create a DatabaseConnection.
  2. For postgres:
    A. You can set sslrootcert=PATH, sslkey=PATH, sslca=PATH in the URI params.
    B. You can set env variables PGSSLCERT=PATH, PGSSLKEY=PATH, PGSSLROOTCERT=PATH
  3. For mysql: You can set ssl-cert, ssl-key=PATH, ssl-ca=PATH in the URI params

Both 3 and 2 require you to mount the keys/certs to a volume and pass a PATH to that.
Only 1 allows you to pass the certs/keys themselves which allows nicer integrations with KMS/Secret Manager but comes at the cost of building the pools yourself,
Which is why I only added the _pem variants of sqlx

@elichai elichai changed the title Add support to client SSL PEM cert and key Add support to client SSL PEM cert and key and root CA PEM cert Oct 10, 2024
@tyt2y3
Copy link
Member

tyt2y3 commented Dec 26, 2024

Small nit, can you use the casing SslMode?

@elichai
Copy link
Contributor Author

elichai commented Jan 2, 2025

Small nit, can you use the casing SslMode?

Sure! Will fix :)

@elichai
Copy link
Contributor Author

elichai commented May 7, 2025

@tyt2y3 Sorry that it took so long, but rebased and fixed

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.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载