The PostgresSSLMode enumeration contains work modes of SSL connection with with PostgreSQL DBMS servers.
It is used by the following properties and methods:
| Value | Brief description |
| 0 | Disable. Connection without use of SSL. |
| 1 | Allow. First, try to connect without use of SSL. If the connection failed, try to connect via SSL. |
| 2 | Prefer. Firs, try to connect via SSL. If the connection failed, try to connect without use of SSL. |
| 3 | Require. Try to connect via SSL only. If there is a root certificate, verify it in the same way as the certificate used in the VerifyCA mode. |
| 4 | VerifyCA. Try to connect via SSL only. Make sure that the DBMS certificate is issued by a trusted certificate authority. |
| 5 | VerifyFull. Try to connect via SSL only. Make sure that the DBMS server certificate is issued by a trusted certification authority, and server name matches with certificate name. |
See also: