|
1 | 1 | <!--
|
2 |
| -$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.27 2000/10/08 09:25:35 ishii Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.28 2000/10/16 03:25:17 momjian Exp $ |
3 | 3 | -->
|
4 | 4 |
|
5 | 5 | <Chapter Id="runtime">
|
@@ -1695,6 +1695,62 @@ openssl x509 -inform PEM -outform PEM -in newreq.pem -out newkey_no_passphrase.p
|
1695 | 1695 | </para>
|
1696 | 1696 | </sect1>
|
1697 | 1697 |
|
| 1698 | + <sect1 id="ssl"> |
| 1699 | + <title>Secure TCP/IP Connection with SSL</title> |
| 1700 | + |
| 1701 | + <para> |
| 1702 | + PostgreSQL has native support for connections over SSL to encrypt |
| 1703 | + client/server communications for increased security. This requires |
| 1704 | + <productname>OpenSSL</productname> to be installed on both client |
| 1705 | + and server systems and support enabled at compile-time using |
| 1706 | + the configure script. |
| 1707 | + </para> |
| 1708 | + |
| 1709 | + <para> |
| 1710 | + With SSL support compiled in, the Postgres backend can be |
| 1711 | + started with argument -l to enable SSL connections. |
| 1712 | + When starting in SSL mode, the postmaster will look for the |
| 1713 | + files <filename>server.key</filename> and |
| 1714 | + <filename>server.cert</filename> in the <envar>PGDATA</envar> |
| 1715 | + directory. These files should contain the server private key and |
| 1716 | + certificate respectively. If the private key is protected with a |
| 1717 | + passphrase, the postmaster will prompt for the passphrase and not |
| 1718 | + start until it has been provided. |
| 1719 | + </para> |
| 1720 | + |
| 1721 | + <para> |
| 1722 | + The postmaster will listen for both standard and SSL connections |
| 1723 | + on the same TCP/IP port, and will negotiate with any connecting |
| 1724 | + client wether to use SSL or not. Use the <filename>pg_hba.conf</filename> |
| 1725 | + file to optionally require SSL in order to accept a connection. |
| 1726 | + </para> |
| 1727 | + |
| 1728 | + <para> |
| 1729 | + For details on how to create your server private key and certificate, |
| 1730 | + refer to the OpenSSL documentation. A simple self-signed certificate |
| 1731 | + can be used to get started testing, but a certificate signed by a CA |
| 1732 | + (either one of the global CAs or a local one) should be used in |
| 1733 | + production so the client can verify the servers identity. To create |
| 1734 | + a quick self-signed certificate, use the <filename>CA.pl</filename> |
| 1735 | + script included in OpenSSL: |
| 1736 | +<programlisting> |
| 1737 | + CA.pl -newcert |
| 1738 | +</programlisting> |
| 1739 | + Fill out the information the script asks for. Make sure to enter |
| 1740 | + the local hostname as Common Name. The script will generate a key |
| 1741 | + which is passphrase protected. To remove the passphrase (required |
| 1742 | + if you want automatic startup of the postmaster), run the command |
| 1743 | +<programlisting> |
| 1744 | + openssl x509 -inform PEM -outform PEM -in newreq.pem -out newkey_no_passphrase.pem |
| 1745 | +</programlisting> |
| 1746 | + Enter the old passphrase to unlock the existing key. Copy the file |
| 1747 | + <filename>newreq.pem</filename> to <filename>PGDATA/server.cert</filename> |
| 1748 | + and <filename>newkey_no_passphrase.pem</filename> to |
| 1749 | + <filename>PGDATA/server.key</filename>. Remove the PRIVATE KEY part |
| 1750 | + from the <filename>server.cert</filename> using any text editor. |
| 1751 | + </para> |
| 1752 | + </sect1> |
| 1753 | + |
1698 | 1754 | <sect1 id="ssh">
|
1699 | 1755 | <title>Secure TCP/IP Connections with SSH tunnels</title>
|
1700 | 1756 |
|
|
0 commit comments