Skip to content

Commit

Permalink
fix documentation on generating the pk8 key. closes: #1585 (#1586)
Browse files Browse the repository at this point in the history
* fix documentation on generating the pk8 key. closes: #1585

* more help on key types and such
  • Loading branch information
magwas authored and davecramer committed Oct 23, 2019
1 parent 69edc0b commit 635cc86
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/documentation/head/connect.md
Expand Up @@ -93,6 +93,8 @@ Connection conn = DriverManager.getConnection(url);
of it specifies a SSL connection. However, for compatibility with future of it specifies a SSL connection. However, for compatibility with future
versions, the value "true" is preferred. For more information see [Chapter versions, the value "true" is preferred. For more information see [Chapter
4, *Using SSL*](ssl.html). 4, *Using SSL*](ssl.html).

Setting up the certificates and keys for ssl connection can be tricky see [The test documentation](https://github.com/pgjdbc/pgjdbc/blob/master/certdir/README.md) for detailed examples.


* **sslfactory** = String * **sslfactory** = String


Expand Down Expand Up @@ -120,20 +122,24 @@ Connection conn = DriverManager.getConnection(url);


Provide the full path for the certificate file. Defaults to /defaultdir/postgresql.crt Provide the full path for the certificate file. Defaults to /defaultdir/postgresql.crt


It can be a PEM encoded X509v3 certificate

*Note:* defaultdir is ${user.home}/.postgresql/ in *nix systems and %appdata%/postgresql/ on windows *Note:* defaultdir is ${user.home}/.postgresql/ in *nix systems and %appdata%/postgresql/ on windows


* **sslkey** = String * **sslkey** = String


Provide the full path for the key file. Defaults to /defaultdir/postgresql.pk8. Provide the full path for the key file. Defaults to /defaultdir/postgresql.pk8.


*Note:* The key file **must** be in [DER format](https://wiki.openssl.org/index.php/DER). A PEM key can be converted to DER format using the openssl command: *Note:* The key file **must** be in [PKCS-8](https://en.wikipedia.org/wiki/PKCS_8) [DER format](https://wiki.openssl.org/index.php/DER). A PEM key can be converted to DER format using the openssl command:


`openssl pkcs8 -topk8 -inform PEM -in my.key -outform DER -out my.key.der` `openssl pkcs8 -topk8 -inform PEM -in my.key -outform DER -out my.key.der -v1 PBE-MD5-DES`


* **sslrootcert** = String * **sslrootcert** = String


File name of the SSL root certificate. Defaults to defaultdir/root.crt File name of the SSL root certificate. Defaults to defaultdir/root.crt


It can be a PEM encoded X509v3 certificate

* **sslhostnameverifier** = String * **sslhostnameverifier** = String


Class name of hostname verifier. Defaults to using `org.postgresql.ssl.PGjdbcHostnameVerifier` Class name of hostname verifier. Defaults to using `org.postgresql.ssl.PGjdbcHostnameVerifier`
Expand Down

0 comments on commit 635cc86

Please sign in to comment.