|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.228 2007/02/06 03:03:11 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.229 2007/02/16 02:59:40 momjian Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="libpq">
|
4 | 4 | <title><application>libpq</application> - C Library</title>
|
@@ -4174,6 +4174,18 @@ setting, and is only available if
|
4174 | 4174 | </listitem>
|
4175 | 4175 | <listitem>
|
4176 | 4176 | <para>
|
| 4177 | +<indexterm> |
| 4178 | +<primary><envar>PGSSLKEY</envar></primary> |
| 4179 | +</indexterm> |
| 4180 | +<envar>PGSSLKEY</envar> |
| 4181 | +specifies the hardware token which stores the secret key for the client |
| 4182 | +certificate, instead of a file. The value of this variable should consist |
| 4183 | +of a colon-separated engine name (engines are <productname>OpenSSL</> |
| 4184 | +loadable modules) and an engine-specific key identifier. |
| 4185 | +</para> |
| 4186 | +</listitem> |
| 4187 | +<listitem> |
| 4188 | +<para> |
4177 | 4189 | <indexterm>
|
4178 | 4190 | <primary><envar>PGKRBSRVNAME</envar></primary>
|
4179 | 4191 | </indexterm>
|
@@ -4438,19 +4450,44 @@ ldap://ldap.mycompany.com/dc=mycompany,dc=com?uniqueMember?one?(cn=mydatabase)
|
4438 | 4450 | for increased security. See <xref linkend="ssl-tcp"> for details
|
4439 | 4451 | about the server-side <acronym>SSL</> functionality.
|
4440 | 4452 | </para>
|
4441 |
| - |
| 4453 | + <para> |
| 4454 | + <application>libpq</application> reads the system-wide |
| 4455 | + <productname>OpenSSL</productname> configuration file. By default, this |
| 4456 | + file is named <filename>openssl.cnf</filename> and is located in the |
| 4457 | + directory reported by <application>openssl</>: |
| 4458 | + <programlisting> |
| 4459 | + openssl version -d |
| 4460 | + </programlisting> |
| 4461 | + The default can be overriden by setting environment variable |
| 4462 | + <envar>OPENSSL_CONF</envar> to the name of the desired configuration |
| 4463 | + file. |
| 4464 | + </para> |
4442 | 4465 | <para>
|
4443 | 4466 | If the server demands a client certificate,
|
4444 | 4467 | <application>libpq</application>
|
4445 | 4468 | will send the certificate stored in file
|
4446 | 4469 | <filename>~/.postgresql/postgresql.crt</> within the user's home directory.
|
4447 | 4470 | A matching private key file <filename>~/.postgresql/postgresql.key</>
|
4448 |
| - must also be present, and must not be world-readable. |
| 4471 | + must also be present, and must not be world-readable, unless the secret |
| 4472 | + key is stored in a hardware token, as specified by |
| 4473 | + <envar>PGSSLKEY</envar>. |
4449 | 4474 | (On Microsoft Windows these files are named
|
4450 | 4475 | <filename>%APPDATA%\postgresql\postgresql.crt</filename> and
|
4451 | 4476 | <filename>%APPDATA%\postgresql\postgresql.key</filename>.)
|
4452 | 4477 | </para>
|
4453 | 4478 |
|
| 4479 | + <para> |
| 4480 | + If the environment variable <envar>PGSSLKEY</envar> is set, its value |
| 4481 | + should consist of a colon-separated engine name and key identifier. In |
| 4482 | + this case, <application>libpq</application> will load the specified |
| 4483 | + engine, i.e. the <productname>OpenSSL</> module which supports special |
| 4484 | + hardware and reference the key with the specified identifier. |
| 4485 | + Identifiers are engine-specific. Typically, cryptography hardware tokens |
| 4486 | + do not reveal secret keys to the application. Instead, applications |
| 4487 | + delegate all cryptography operations which require the secret key to |
| 4488 | + the hardware token. |
| 4489 | + </para> |
| 4490 | + |
4454 | 4491 | <para>
|
4455 | 4492 | If the file <filename>~/.postgresql/root.crt</> is present in the user's
|
4456 | 4493 | home directory,
|
|
0 commit comments