postgresql/src/backend/libpq
Tom Lane e481d26285 Clean up minor warnings from buildfarm.
Be more consistent about use of XXXGetDatum macros in new jsonpath
code.  This is mostly to avoid having code that looks randomly
different from everyplace else that's doing the exact same thing.

In pg_regress.c, avoid an unreferenced-function warning from
compilers that don't understand pg_attribute_unused().  Putting
the function inside the same #ifdef as its only caller is more
straightforward coding anyway.

In be-secure-openssl.c, avoid use of pg_attribute_unused() on a label.
That's pretty creative, but there's no good reason to suppose that
it's portable, and there's absolutely no need to use goto's here in the
first place.  (This wasn't actually causing any buildfarm complaints,
but it's new code in v12 so it has no portability track record.)
2019-04-28 12:45:55 -04:00
..
Makefile GSSAPI encryption support 2019-04-03 15:02:33 -04:00
README.SSL Move EDH support to common files 2018-01-23 07:11:38 -05:00
auth-scram.c Fix detection of passwords hashed with MD5 or SCRAM-SHA-256 2019-04-23 15:43:21 +09:00
auth.c GSSAPI encryption support 2019-04-03 15:02:33 -04:00
be-fsstubs.c Tighten use of OpenTransientFile and CloseTransientFile 2019-03-09 08:50:55 +09:00
be-gssapi-common.c GSSAPI encryption support 2019-04-03 15:02:33 -04:00
be-gssapi-common.h GSSAPI encryption support 2019-04-03 15:02:33 -04:00
be-secure-common.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
be-secure-gssapi.c Fix assorted minor bogosity in GSSAPI transport error messages. 2019-04-17 17:06:50 -04:00
be-secure-openssl.c Clean up minor warnings from buildfarm. 2019-04-28 12:45:55 -04:00
be-secure.c GSSAPI encryption support 2019-04-03 15:02:33 -04:00
crypt.c Fix detection of passwords hashed with MD5 or SCRAM-SHA-256 2019-04-23 15:43:21 +09:00
hba.c GSSAPI encryption support 2019-04-03 15:02:33 -04:00
ifaddr.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_hba.conf.sample Rename "scram" to "scram-sha-256" in pg_hba.conf and password_encryption. 2017-04-18 14:50:50 +03:00
pg_ident.conf.sample Reformat the comments in pg_hba.conf and pg_ident.conf 2010-01-26 06:58:39 +00:00
pqcomm.c Add support TCP user timeout in libpq and the backend server 2019-04-06 15:23:37 +09:00
pqformat.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pqmq.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
pqsignal.c Update copyright for 2019 2019-01-02 12:44:25 -05:00

README.SSL

src/backend/libpq/README.SSL

SSL
===

>From the servers perspective:


  Receives StartupPacket
           |
           |
 (Is SSL_NEGOTIATE_CODE?) -----------  Normal startup
           |                  No
           |
           | Yes
           |
           |
 (Server compiled with USE_SSL?) ------- Send 'N'
           |                       No        |
           |                                 |
           | Yes                         Normal startup
           |
           |
        Send 'S'
           |
           |
      Establish SSL
           |
           |
      Normal startup





>From the clients perspective (v6.6 client _with_ SSL):


      Connect
         |
         |
  Send packet with SSL_NEGOTIATE_CODE
         |
         |
  Receive single char  ------- 'S' -------- Establish SSL
         |                                       |
         | '<else>'                              |
         |                                  Normal startup
         |
         |
   Is it 'E' for error  ------------------- Retry connection
         |                  Yes             without SSL
         | No
         |
   Is it 'N' for normal ------------------- Normal startup
         |                  Yes
         |
   Fail with unknown

---------------------------------------------------------------------------

Ephemeral DH
============

Since the server static private key ($DataDir/server.key) will
normally be stored unencrypted so that the database backend can
restart automatically, it is important that we select an algorithm
that continues to provide confidentiality even if the attacker has the
server's private key.  Ephemeral DH (EDH) keys provide this and more
(Perfect Forward Secrecy aka PFS).

N.B., the static private key should still be protected to the largest
extent possible, to minimize the risk of impersonations.

Another benefit of EDH is that it allows the backend and clients to
use DSA keys.  DSA keys can only provide digital signatures, not
encryption, and are often acceptable in jurisdictions where RSA keys
are unacceptable.

The downside to EDH is that it makes it impossible to use ssldump(1)
if there's a problem establishing an SSL session.  In this case you'll
need to temporarily disable EDH (see initialize_dh()).