# ssl_prefer_server_ciphers

> ssl_prefer_server_ciphers is the PostgreSQL setting that gives priority to server ciphersuite order.
---

> [!NOTE]
> **Fact — official short description:** “Give priority to server ciphersuite order.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `bool` | Upstream pg_settings type |
| Context | `sighup` | Takes effect after configuration reload |
| Unit | — | Raw unit |
| Range | — | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Connections and Authentication / SSL | Upstream classification |
| Latest boot value | `on` | on |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.4 |
| Present in | PG9.4–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`ef3267523d1e`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=ef3267523d1ecf53bb6d4ffbeb6a0ae1af84ed47) — SSL: Add configuration option to prefer server cipher order |
| Commit date | 2013-12-07 |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.4–19 Beta 3 | `on` | — | on |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

ssl_prefer_server_ciphers gives priority to server ciphersuite order. It affects server-versus-client ordering only for TLS 1.2 and older; TLS 1.3 negotiation does not use this switch.

ssl_prefer_server_ciphers is a SIGHUP-context setting: a configuration reload activates the new server value without a restart; subsequent operations that consult it use the refreshed value. Existing TLS sessions are not renegotiated.

It participates in the TLS context used for new handshakes. ssl enables transport, pg_hba.conf decides which connection classes require it, and the certificate, key, CA, revocation, protocol, and cipher settings must form one valid policy.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | Treat ssl_prefer_server_ciphers as transport-security policy rather than a performance knob. Follow the organization's TLS baseline and test certificate rotation, reload, and every client class. |
| OLAP | Use the same TLS floor for analytical traffic; benchmark only after correctness because bulk transfer may expose CPU cost but is not a reason to accept obsolete protocols. |
| Small nodes | Keep ssl_prefer_server_ciphers simple and secure, using managed certificates and library defaults reviewed for the installed OpenSSL version. Rehearse renewal before expiry. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.4–19 Beta 3 unmodified; OLAP: PG9.4–19 Beta 3 unmodified; CRIT: PG9.4–19 Beta 3 unmodified; TINY: PG9.4–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Editing ssl_prefer_server_ciphers without reloading configuration and verifying the effective value and subsequent behavior.
- Updating only one TLS file or policy knob and leaving an invalid chain, unreadable key, or incompatible protocol set.
- Assuming a reload renegotiates existing sessions; TLS policy changes affect new handshakes.
- Assuming it controls TLS 1.3 cipher ordering.

## Related parameters {#related-parameters}

[`ssl_ciphers`](/parameters/ssl-ciphers/) · [`ssl_tls13_ciphers`](/parameters/ssl-tls13-ciphers/) · [`ssl_min_protocol_version`](/parameters/ssl-min-protocol-version/) · [`ssl_max_protocol_version`](/parameters/ssl-max-protocol-version/) · [`ssl_groups`](/parameters/ssl-groups/)

## References {#references}

- [PostgreSQL 19 Beta 3 — ssl_prefer_server_ciphers](https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-SSL-PREFER-SERVER-CIPHERS)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
