<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/mitm-attacks-are-easier-to-avoid-with-psql-postgres-16-pkata8rdr" -->

---
title: MITM attacks are easier to avoid with psql (Postgres) 16
description: The psql client in Postgres 16 introduces a new connection option `sslrootcert=system` that makes it easy to establish properly authenticated, encrypted...
canonical: https://daily.dev/posts/mitm-attacks-are-easier-to-avoid-with-psql-postgres-16-pkata8rdr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: MITM attacks are easier to avoid with psql (Postgres) 16 | daily.dev
og:description: The psql client in Postgres 16 introduces a new connection option `sslrootcert=system` that makes it easy to establish properly authenticated, encrypted...
og:url: https://daily.dev/posts/mitm-attacks-are-easier-to-avoid-with-psql-postgres-16-pkata8rdr
og:image: https://api.daily.dev/og/posts/PKata8rdr.png
og:image:alt: MITM attacks are easier to avoid with psql (Postgres) 16
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MITM attacks are easier to avoid with psql (Postgres) 16

**[Neon](https://daily.dev/sources/neontech)** · 9 min read · 0 upvotes · 0 comments

## Summary

The psql client in Postgres 16 introduces a new connection option `sslrootcert=system` that makes it easy to establish properly authenticated, encrypted connections to PostgreSQL databases. Prior to this, the commonly used `sslmode=require` option only provided encryption but not server authentication, leaving connections vulnerable to MITM attacks via DNS spoofing. The author demonstrates this vulnerability with a proof-of-concept attack completed in under a morning, then explains how `sslrootcert=system` fixes it by using the OS's trusted CA certificates and enforcing `sslmode=verify-full`. The post also covers the new `require_auth` option and recommends setting secure defaults in shell profiles to prevent accidental insecure connections.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://neon.com/blog/avoid-mitm-attacks-with-psql-postgres-16>

## Similar posts on daily.dev

- [Enforcing TLS and managing certificate rotation for RDS and Amazon Aurora PostgreSQL](https://daily.dev/posts/enforcing-tls-and-managing-certificate-rotation-for-rds-and-amazon-aurora-postgresql-mruniy8os) · AWS Database Blog · 0 upvotes · 0 comments
- [Stop MITM on the first SSH connection, on any VPS or cloud provider](https://daily.dev/posts/stop-mitm-on-the-first-ssh-connection-on-any-vps-or-cloud-provider-ppeoanltg) · Lobsters · 1 upvotes · 0 comments
- [Ctrl-C in psql gives me the heebie-jeebies](https://daily.dev/posts/ctrl-c-in-psql-gives-me-the-heebie-jeebies-yovccjvap) · Neon · 0 upvotes · 0 comments
- [Why Certificate Pinning Alone Won’t Stop Modern MITM Attacks](https://daily.dev/posts/why-certificate-pinning-alone-won-t-stop-modern-mitm-attacks-ly2ys6iwc) · ProAndroidDev · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/mitm-attacks-are-easier-to-avoid-with-psql-postgres-16-pkata8rdr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"MITM attacks are easier to avoid with psql (Postgres) 16","url":"https://daily.dev/posts/mitm-attacks-are-easier-to-avoid-with-psql-postgres-16-pkata8rdr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/mitm-attacks-are-easier-to-avoid-with-psql-postgres-16-pkata8rdr"},"datePublished":"2026-07-09T06:57:48.971Z","dateModified":"2026-07-09T07:01:33.837Z","description":"The psql client in Postgres 16 introduces a new connection option `sslrootcert=system` that makes it easy to establish properly authenticated, encrypted...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1fef6a7f61fea359bfb52e95756df64e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/1fef6a7f61fea359bfb52e95756df64e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Neon","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Neon","logo":"https://media.daily.dev/image/upload/s--65EDghou--/f_auto/v1724339118/logos/neontech","url":"https://daily.dev/sources/neontech"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/mitm-attacks-are-easier-to-avoid-with-psql-postgres-16-pkata8rdr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,postgresql","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Neon","item":"https://daily.dev/sources/neontech"},{"@type":"ListItem","position":3,"name":"MITM attacks are easier to avoid with psql (Postgres) 16"}]}
```

