From 9357d177f07f20f21e896958cec9992a60515195 Mon Sep 17 00:00:00 2001 From: Greg Stark Date: Fri, 31 Mar 2023 03:01:35 -0400 Subject: [PATCH v5 6/6] Some added docs --- doc/src/sgml/protocol.sgml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 8b5e7b1ad7..dd363656fd 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1532,17 +1532,54 @@ SELCT 1/0; bytes. + + Likewise the server expects the client to not begin + the SSL negotiation until it receives the server's + single byte response to the SSL request. If the + client begins the SSL negotiation immediately without + waiting for the server response to be received it can reduce connection + latency by one round-trip. However this comes at the cost of not being + able to handle the case where the server sends a negative response to the + SSL request. In that case instead of continuing with either GSSAPI or an + unencrypted connection or a protocol error the server will simply + disconnect. + + An initial SSLRequest can also be used in a connection that is being opened to send a CancelRequest message. + + A second alternate way to initiate SSL encryption is + available. The server will recognize connections which immediately + begin SSL negotiation without any previous SSLRequest + packets. Once the SSL connection is established the + server will expect a normal startup-request packet and continue + negotiation over the encrypted channel. In this case any other requests + for encryption will be refused. This method is not preferred for general + purpose tools as it cannot negotiate the best connection encryption + available or handle unencrypted connections. However it is useful for + environments where both the server and client are controlled together. + In that case it avoids one round trip of latency and allows the use of + network tools that depend on standard SSL connections. + When using SSL connections in this style the client is + required to use the ALPN extension defined + by RFC 7301 to + protect against protocol confusion attacks. + The PostgreSQL protocol is "TBD-pgsql" as + registered + at IANA + TLS ALPN Protocol IDs registry. + + While the protocol itself does not provide a way for the server to force SSL encryption, the administrator can configure the server to reject unencrypted sessions as a byproduct of authentication checking. + -- 2.40.0