Skip to content

docs: show working connectionString and custom CA configuration - #3862

Open
Fardeen-coder666 wants to merge 1 commit into
brianc:masterfrom
Fardeen-coder666:docs/connection-string-custom-ca
Open

Fardeen-coder666 wants to merge 1 commit into
brianc:masterfrom
Fardeen-coder666:docs/connection-string-custom-ca

Conversation

@Fardeen-coder666

Copy link
Copy Markdown

The SSL guide explains that URL SSL parameters replace the config object's ssl options, but the adjacent example only demonstrates the failing configuration. Add a working alternative that keeps the CA and certificate verification in the ssl object while preserving unrelated query parameters.

Related to #3355. This is a documentation clarification; it does not change driver behavior.

Validation: checked configuration construction with pg 8.23.1, using a synthetic CA buffer and no network connection. Confirmed that the working example retains ssl.ca, rejectUnauthorized: true, and application_name; also reproduced loss of ssl.ca when sslmode=require is present. A live PostgreSQL/TLS connection and the documentation site build were not run.

Prepared with AI assistance; the example was checked against the connection-parameter merge implementation and the existing issue discussion.

connectionString: 'postgres://user:password@localhost:5432/db?application_name=example',
ssl: {
ca: fs.readFileSync('/path/to/server-certificates/root.crt'),
rejectUnauthorized: true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default

Suggested change
rejectUnauthorized: true,

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