You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GSS Encryption Mode | Controls whether GSS encryption is used, depending on server support. [See docs for possible values and more info](security.md). | Prefer
22
23
SSL Mode | Controls whether SSL is used, depending on server support. [See docs for possible values and more info](security.md). | Prefer
23
24
Trust Server Certificate | Whether to trust the server certificate without validating it. [See docs for more info](security.md). | false
24
25
SSL Certificate | Location of a client certificate to be sent to the server. [See docs](security.md). | PGSSLCERT
Copy file name to clipboardExpand all lines: conceptual/Npgsql/release-notes/10.0.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,9 @@ Note that these changes modify the metric names and tracing span tags, and so ar
20
20
21
21
## GSSAPI session encryption
22
22
23
-
GSSAPI session encryption is an alternative to SSL/TLS session encryption, where special temporary tokens are used to encrypt traffic between the client and the server (MIT Kerberos is one of the GSSAPI providers that can be used for that), unlike SSL/TLS, where SSL certificate is used for the same purpose. You can use the `GssEncryptionMode` connection string parameter to control whether GSS session encryption is used; the default is `Prefer`, which will enable the feature if possible but proceed if it's not available. To learn more, see PostgreSQL [docs](https://www.postgresql.org/docs/current/gssapi-enc.html).
23
+
GSSAPI session encryption is an alternative to SSL/TLS session encryption, where special temporary tokens are used to encrypt traffic between the client and the server (MIT Kerberos is one of the GSSAPI providers that can be used for that), unlike SSL/TLS, where the SSL certificate is used for the same purpose. You can use the `GssEncryptionMode` connection string parameter to control whether GSS session encryption is used; the default is `Prefer`, which will enable the feature if possible but proceed if it's not available.
24
+
25
+
To learn more, [see the security and encryption docs](../security.md).
Any physical connection that's opened after this point will use the newly-injected password.
39
39
40
-
## Encryption (SSL/TLS)
40
+
## GSS session encryption (GSS-API)
41
+
42
+
Connections to PostgreSQL are unencrypted by default, but you can turn on session encryption if you wish. Npgsql 10 supports GSS-API for session encryption, and defaults to it if PostgreSQL is set up to support GSS-API (GSS-API is preferred over SSL/TLS).
41
43
42
-
By default PostgreSQL connections are unencrypted, but you can turn on SSL/TLS encryption if you wish. First, you have to set up your PostgreSQL to receive SSL/TLS connections [as described here](http://www.postgresql.org/docs/current/static/ssl-tcp.html). Once that's done, specify `SSL Mode` in your connection string as detailed below.
44
+
To use GSS-API, configure your PostgreSQL for GSS-API session encryption ([docs](https://www.postgresql.org/docs/current/gssapi-enc.html)). Once that's done, you can use `GSS Encryption Mode` in your connection string to configure support (this is similar to the PG [`gccencmode`](https://www.postgresql.org/docs/16/libpq-connect.html#LIBPQ-CONNECT-GSSENCMODE) parameter):
43
45
44
-
### [Version 6.0+](#tab/tabid-1)
46
+
SSL Mode | Meaning
47
+
------------------- | ---------
48
+
Disable | Only try a non-GSSAPI-encrypted connection.
49
+
Prefer (default) | If there are GSSAPI credentials present (i.e., in a credentials cache), first try a GSSAPI-encrypted connection; if that fails or there are no credentials, try a non-GSSAPI-encrypted connection. This is the default when PostgreSQL has been compiled with GSSAPI support.
50
+
Require | Only try a GSSAPI-encrypted connection.
45
51
46
-
Starting with 6.0, the following `SSL Mode` values are supported (see the [PostgreSQL docs](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS) for more details):
52
+
The default mode is `Prefer`, which allows GSS-API session encryption but does not require it.
53
+
54
+
## Encryption (SSL/TLS)
55
+
56
+
As an alternative to GSS-API, you can use SSL/TLS. First, you have to set up your PostgreSQL to receive SSL/TLS connections [as described here](http://www.postgresql.org/docs/current/static/ssl-tcp.html). Once that's done, specify `SSL Mode` in your connection string as detailed below.
57
+
58
+
The following `SSL Mode` values are supported (see the [PostgreSQL docs](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS) for more details):
@@ -54,25 +66,7 @@ Require<sup>1</sup> | Yes | No |
54
66
VerifyCA | Yes | Depends on CA policy | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server that I trust.
55
67
VerifyFull | Yes | Yes | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server I trust, and that it's the one I specify.
56
68
57
-
<sup>1</sup> Prior to Npgsql 8.0, `SSL Mode=Require` required explicitly setting `Trust Server Certificate=true` as well, to make it explicit that the server certificate isn't validated. Starting with 8.0, `Trust Server Certificate=true` is no longer required and does nothing.
58
-
59
-
The default mode in 6.0+ is `Prefer`, which allows SSL but does not require it, and does not validate certificates.
60
-
61
-
### [Older versions](#tab/tabid-2)
62
-
63
-
Versions prior to 6.0 supported the following `SSL Mode` values:
Disable | No | No | I don't care about security, and I don't want to pay the overhead of encryption.
68
-
Prefer | Maybe | Maybe | I don't care about encryption, but I wish to pay the overhead of encryption if the server supports it.
69
-
Require | Yes | Yes | I want my data encrypted, and I accept the overhead. I want to be sure that I connect to a server I trust, and that it's the one I specify.
70
-
71
-
The default mode prior to 6.0 was `Disable`.
72
-
73
-
To disable certificate validation when using `Require`, set `Trust Server Certificate` to true; this allows connecting to servers with e.g. self-signed certificates, while still requiring encryption.
74
-
75
-
---
69
+
The default mode is `Prefer`, which allows SSL but does not require it, and does not validate certificates.
0 commit comments