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
serverless-dns also support TLS PSK ciphersuites when env var `TLS_PSK` is set to hex or base64 of randomly generated 64 bytes. Works only on cloud deployments that terminate their own TLS (like on Fly.io).
164
+
165
+
#### TLS PSK
166
+
167
+
The PSK server-hint sent to the TLS 1.2 clients is [psk.js:serverid (`888811119999`)](https://github.com/serverless-dns/serverless-dns/blob/1c75b95c2ab6/src/core/psk.js#L11).
168
+
169
+
*Static PSK*: TLS 1.2 clients must set client-hint to [psk.js:fixedID64 (`790bb453...ffae2452`)](https://github.com/serverless-dns/serverless-dns/blob/1c75b95c2ab6/src/core/psk.js#L14-L20). The static pre-shared key is then derived from `hkdf(key, id)` where `key` is itself `hkdf(seed, ctx, salt)`:
170
+
-`seed` is env var `TLS_PSK` converted to bytes from base64 or hex.
171
+
-`ctx` is utf-8 encoding of string `pskkeyfixedderivationcontext`.
172
+
-`salt` is fixed to [`44f402e7...91a6e3ce`](https://github.com/serverless-dns/serverless-dns/blob/1c75b95c2ab6/src/core/psk.js#L21-L27) converted to bytes.
173
+
-`id` is the static client-hint (`790bb453...ffae2452`) converted to bytes.
174
+
175
+
*Dynamic PSK*: To dynamically generate PSK identity and key (derived from env var `TLS_PSK`), invoke `<my-domain.tld>/gentlspsk`. The returned credentials are valid as long as `TLS_PSK` is unchanged:
176
+
177
+
```js
178
+
{
179
+
// 64 hex chars; id is to be used as-is as the psk client identity.
180
+
"id":"43dc2df4...6d332545",
181
+
// 128 hex chars; convert to 64-length byte array to use as psk shared secret.
182
+
"psk":"ebc9ab07...03629dd4"
183
+
}
184
+
```
185
+
163
186
#### Logs and Analytics
164
187
165
188
serverless-dns can be setup to upload logs via Cloudflare *Logpush*.
@@ -226,7 +249,7 @@ TLS_OFFLOAD="true"
226
249
# OR: base64 representation of both key (private) and cert (public chain)
0 commit comments