@bastani/atomic-storage-postgres 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/postgres.js +1 -20
- package/proxy.d.ts +6 -0
- package/proxy.js +27 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.10.2] - 2026-11-20
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- A server certificate that TLS verification refuses with `INVALID_PURPOSE` (its CA is not marked as a CA, or is limited to client authentication) or `PATH_LENGTH_EXCEEDED` (its chain has more intermediate CAs than its root allows) now fails the open at once, naming the reason and the `sslrootcert` fix, instead of being retried five times as an unreachable server. Several other certificate verification failures that were retried, such as `CERT_REVOKED`, now also fail at once. This applies directly, through a proxy, and to an https proxy's own certificate ([#6074](https://github.com/bastani-inc/atomic/issues/6074)).
|
|
10
|
+
|
|
11
|
+
## [0.10.2-alpha.1] - 2026-11-20
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- A server certificate that TLS verification refuses with `INVALID_PURPOSE` (its CA is not marked as a CA, or is limited to client authentication) or `PATH_LENGTH_EXCEEDED` (its chain has more intermediate CAs than its root allows) now fails the open at once, naming the reason and the `sslrootcert` fix, instead of being retried five times as an unreachable server. Several other certificate verification failures that were retried, such as `CERT_REVOKED`, now also fail at once. This applies directly, through a proxy, and to an https proxy's own certificate ([#6074](https://github.com/bastani-inc/atomic/issues/6074)).
|
|
16
|
+
|
|
5
17
|
## [0.9.90] - 2026-11-19
|
|
6
18
|
|
|
7
19
|
### Added
|
package/package.json
CHANGED
package/postgres.js
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
ProxyTunnelError,
|
|
20
20
|
postgresTransport,
|
|
21
21
|
socketOpener,
|
|
22
|
+
TLS_VERIFICATION_CODES,
|
|
22
23
|
} from "./proxy.js";
|
|
23
24
|
|
|
24
25
|
/**
|
|
@@ -65,26 +66,6 @@ const CANCEL_REQUEST_CODE = 80877102;
|
|
|
65
66
|
const DATABASE_LOCK_SCOPE = "atomic";
|
|
66
67
|
/** The oldest server major version the adapter supports. */
|
|
67
68
|
const MINIMUM_SERVER_VERSION = 140000;
|
|
68
|
-
/**
|
|
69
|
-
* Node's codes for a server certificate that TLS verification refused: the same on every attempt, so never retried.
|
|
70
|
-
* @type {ReadonlySet<string>}
|
|
71
|
-
*/
|
|
72
|
-
const TLS_VERIFICATION_CODES = new Set([
|
|
73
|
-
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
74
|
-
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
75
|
-
"UNABLE_TO_GET_ISSUER_CERT",
|
|
76
|
-
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
77
|
-
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
78
|
-
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
79
|
-
"CERT_HAS_EXPIRED",
|
|
80
|
-
"CERT_NOT_YET_VALID",
|
|
81
|
-
"CERT_UNTRUSTED",
|
|
82
|
-
"CERT_REJECTED",
|
|
83
|
-
"CERT_SIGNATURE_FAILURE",
|
|
84
|
-
"CERT_CHAIN_TOO_LONG",
|
|
85
|
-
"INVALID_CA",
|
|
86
|
-
"HOSTNAME_MISMATCH",
|
|
87
|
-
]);
|
|
88
69
|
|
|
89
70
|
/**
|
|
90
71
|
* The permanent failure a connection refused by TLS verification is (#5218), with the reason and the fix: a host name
|
package/proxy.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export type PostgresSocketFactory = (target: ProxyTarget) => Duplex | Promise<Du
|
|
|
15
15
|
/** How long a proxy may take to accept a connection and answer its tunnel request, in milliseconds. */
|
|
16
16
|
export const PROXY_ANSWER_TIMEOUT_MS: 8000;
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* The codes of a certificate TLS verification refused, for a server's certificate and an https proxy's: a connection
|
|
20
|
+
* that fails with one is not retried.
|
|
21
|
+
*/
|
|
22
|
+
export const TLS_VERIFICATION_CODES: ReadonlySet<string>;
|
|
23
|
+
|
|
18
24
|
/**
|
|
19
25
|
* Whether a `NO_PROXY` value exempts `host` on `port`, as Atomic's HTTPS clients decide it: entries separated by commas
|
|
20
26
|
* or white space; a host matches itself and its subdomains, `*.name` only subdomains, `*` every host; an entry with a
|
package/proxy.js
CHANGED
|
@@ -20,24 +20,40 @@ const MAX_PROXY_ANSWER_BYTES = 16 * 1024;
|
|
|
20
20
|
const MAX_REASON_LENGTH = 80;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* The codes of a certificate TLS verification refused, which it refuses the same way on every attempt, so a connection
|
|
24
|
+
* that fails with one is never retried (#6074): the host name check's code and Node's X509 certificate error codes,
|
|
25
|
+
* which Bun's `node:tls` reports too, except `OUT_OF_MEM`, which says nothing about the certificate. The adapter
|
|
26
|
+
* refuses a server's certificate with them, and an https proxy's.
|
|
25
27
|
* @type {ReadonlySet<string>}
|
|
26
28
|
*/
|
|
27
|
-
const TLS_VERIFICATION_CODES = new Set([
|
|
29
|
+
export const TLS_VERIFICATION_CODES = new Set([
|
|
28
30
|
"ERR_TLS_CERT_ALTNAME_INVALID",
|
|
29
|
-
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
30
31
|
"UNABLE_TO_GET_ISSUER_CERT",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"CERT_NOT_YET_VALID",
|
|
36
|
-
"CERT_UNTRUSTED",
|
|
37
|
-
"CERT_REJECTED",
|
|
32
|
+
"UNABLE_TO_GET_CRL",
|
|
33
|
+
"UNABLE_TO_DECRYPT_CERT_SIGNATURE",
|
|
34
|
+
"UNABLE_TO_DECRYPT_CRL_SIGNATURE",
|
|
35
|
+
"UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
|
|
38
36
|
"CERT_SIGNATURE_FAILURE",
|
|
37
|
+
"CRL_SIGNATURE_FAILURE",
|
|
38
|
+
"CERT_NOT_YET_VALID",
|
|
39
|
+
"CERT_HAS_EXPIRED",
|
|
40
|
+
"CRL_NOT_YET_VALID",
|
|
41
|
+
"CRL_HAS_EXPIRED",
|
|
42
|
+
"ERROR_IN_CERT_NOT_BEFORE_FIELD",
|
|
43
|
+
"ERROR_IN_CERT_NOT_AFTER_FIELD",
|
|
44
|
+
"ERROR_IN_CRL_LAST_UPDATE_FIELD",
|
|
45
|
+
"ERROR_IN_CRL_NEXT_UPDATE_FIELD",
|
|
46
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
47
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
48
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
49
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
39
50
|
"CERT_CHAIN_TOO_LONG",
|
|
51
|
+
"CERT_REVOKED",
|
|
40
52
|
"INVALID_CA",
|
|
53
|
+
"PATH_LENGTH_EXCEEDED",
|
|
54
|
+
"INVALID_PURPOSE",
|
|
55
|
+
"CERT_UNTRUSTED",
|
|
56
|
+
"CERT_REJECTED",
|
|
41
57
|
"HOSTNAME_MISMATCH",
|
|
42
58
|
]);
|
|
43
59
|
|