Re: sslmode=secure by default (Re: Making sslrootcert=system work on Windows psql) - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: sslmode=secure by default (Re: Making sslrootcert=system work on Windows psql)
Date
Msg-id aAoYKnRfssJljlV2@msg.df7cb.de
Whole thread Raw
In response to Re: sslmode=secure by default (Re: Making sslrootcert=system work on Windows psql)  (George MacKerron <george@mackerron.co.uk>)
Responses Re: sslmode=secure by default (Re: Making sslrootcert=system work on Windows psql)
List pgsql-hackers
Re: George MacKerron
> > Before we can make this change, I think we would have to improve the
> > UX. psql does not even have any --switch for it. PostgreSQL serving
> > non-SSL and SSL on the same port doesn't make the UX better... :-/
> 
> How do you think the UX could be improved? Maybe by using a psql switch and/or an env var to opt out of (or initially
evento opt into) the new sslmode treatment?
 

The env var is already there (PGSSLMODE).

Now you can say `psql -h db.example.com -p 5433 dbfoo`, but for
specifying the sslmode, you have to rewrite at least the last argument
to use connection string syntax, `psql "dbname=dbfoo sslmode=verify-full`.
This needs be be less cumbersome. (And the names of the options make
me want to stay away from them, require/verify-ca/verify-full/verify-confusing.
Your sslmode=secure idea is really good.)

It should be as simple as
psql --ssl (= sslmode=secure)
psql --insecure (the old sslmode=require)
psql --no-ssl (= sslmode=disable)

psql -s and -S are unfortunately already taken :-/

For connection strings, perhaps the best action is to tell people that
always including "sslmode=something" is best practise. For libpq-style
key=value connection strings, that wouldn't even be ugly. For
postgresql://-style strings, we would ideally have something like http://
vs https://, but I am not sure how to squeeze that into the syntax.
(Appending ?sslmode= works, but meh.)

Christoph



pgsql-hackers by date:

Previous
From: George MacKerron
Date:
Subject: Re: sslmode=secure by default (Re: Making sslrootcert=system work on Windows psql)
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: What's our minimum supported Python version?