@@ -1740,8 +1740,8 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
1740
1740
encryption, regardless of the value of <literal>sslmode</literal>.
1741
1741
To force use of <acronym>SSL</acronym> encryption in an
1742
1742
environment that has working <acronym>GSSAPI</acronym>
1743
- infrastructure (such as a Kerberos server), also
1744
- set <literal>gssencmode</literal> to <literal>disable</literal>.
1743
+ infrastructure (such as a Kerberos server), also set
1744
+ <literal>gssencmode</literal> to <literal>disable</literal>.
1745
1745
</para>
1746
1746
</listitem>
1747
1747
</varlistentry>
@@ -1768,6 +1768,67 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
1768
1768
</listitem>
1769
1769
</varlistentry>
1770
1770
1771
+ <varlistentry id="libpq-connect-sslnegotiation" xreflabel="sslnegotiation">
1772
+ <term><literal>sslnegotiation</literal></term>
1773
+ <listitem>
1774
+ <para>
1775
+ This option controls whether <productname>PostgreSQL</productname>
1776
+ will perform its protocol negotiation to request encryption from the
1777
+ server or will just directly make a standard <acronym>SSL</acronym>
1778
+ connection. Traditional <productname>PostgreSQL</productname>
1779
+ protocol negotiation is the default and the most flexible with
1780
+ different server configurations. If the server is known to support
1781
+ direct <acronym>SSL</acronym> connections then the latter requires one
1782
+ fewer round trip reducing connection latency and also allows the use
1783
+ of protocol agnostic SSL network tools.
1784
+ </para>
1785
+
1786
+ <variablelist>
1787
+ <varlistentry>
1788
+ <term><literal>postgres</literal></term>
1789
+ <listitem>
1790
+ <para>
1791
+ perform <productname>PostgreSQL</productname> protocol
1792
+ negotiation. This is the default if the option is not provided.
1793
+ </para>
1794
+ </listitem>
1795
+ </varlistentry>
1796
+
1797
+ <varlistentry>
1798
+ <term><literal>direct</literal></term>
1799
+ <listitem>
1800
+ <para>
1801
+ first attempt to establish a standard SSL connection and if that
1802
+ fails reconnect and perform the negotiation. This fallback
1803
+ process adds significant latency if the initial SSL connection
1804
+ fails.
1805
+ </para>
1806
+ </listitem>
1807
+ </varlistentry>
1808
+
1809
+ <varlistentry>
1810
+ <term><literal>requiredirect</literal></term>
1811
+ <listitem>
1812
+ <para>
1813
+ attempt to establish a standard SSL connection and if that fails
1814
+ return a connection failure immediately.
1815
+ </para>
1816
+ </listitem>
1817
+ </varlistentry>
1818
+ </variablelist>
1819
+
1820
+ <para>
1821
+ Note that if <literal>gssencmode</literal> is set
1822
+ to <literal>prefer</literal>, a <acronym>GSS</acronym> connection is
1823
+ attempted first. If the server ejectes GSS encryption, SSL is
1824
+ negotiated over the same TCP connection using the traditional postgres
1825
+ protocol, regardless of <literal>sslnegotiation</literal>. In other
1826
+ words, the direct SSL handshake is not used, if a TCP connection has
1827
+ already been established and can be used for the SSL handshake.
1828
+ </para>
1829
+ </listitem>
1830
+ </varlistentry>
1831
+
1771
1832
<varlistentry id="libpq-connect-sslcompression" xreflabel="sslcompression">
1772
1833
<term><literal>sslcompression</literal></term>
1773
1834
<listitem>
@@ -2001,11 +2062,13 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
2001
2062
2002
2063
<para>
2003
2064
The Server Name Indication can be used by SSL-aware proxies to route
2004
- connections without having to decrypt the SSL stream. (Note that this
2005
- requires a proxy that is aware of the PostgreSQL protocol handshake,
2006
- not just any SSL proxy.) However, <acronym>SNI</acronym> makes the
2007
- destination host name appear in cleartext in the network traffic, so
2008
- it might be undesirable in some cases.
2065
+ connections without having to decrypt the SSL stream. (Note that
2066
+ unless the proxy is aware of the PostgreSQL protocol handshake this
2067
+ would require setting <literal>sslnegotiation</literal>
2068
+ to <literal>direct</literal> or <literal>requiredirect</literal>.)
2069
+ However, <acronym>SNI</acronym> makes the destination host name appear
2070
+ in cleartext in the network traffic, so it might be undesirable in
2071
+ some cases.
2009
2072
</para>
2010
2073
</listitem>
2011
2074
</varlistentry>
@@ -8676,6 +8739,16 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
8676
8739
</para>
8677
8740
</listitem>
8678
8741
8742
+ <listitem>
8743
+ <para>
8744
+ <indexterm>
8745
+ <primary><envar>PGSSLNEGOTIATION</envar></primary>
8746
+ </indexterm>
8747
+ <envar>PGSSLNEGOTIATION</envar> behaves the same as the <xref
8748
+ linkend="libpq-connect-sslnegotiation"/> connection parameter.
8749
+ </para>
8750
+ </listitem>
8751
+
8679
8752
<listitem>
8680
8753
<para>
8681
8754
<indexterm>
0 commit comments