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
// hard fail if someone tries to explicitly enable both
428
+
returnerrors.New("private networking (swarm.key / LIBP2P_FORCE_PNET) does not work with AutoTLS.Enabled=true, update config to remove this message")
429
+
} else {
430
+
// print error and disable autotls if user runs on default settings
431
+
log.Error("private networking (swarm.key / LIBP2P_FORCE_PNET) is not compatible with AutoTLS. Set AutoTLS.Enabled=false in config to remove this message.")
logger.Fatal("Invalid configuration: AutoTLS.AutoWSS=true requires at least one /tcp listener present in Addresses.Swarm, see https://github.com/ipfs/kubo/blob/master/docs/config.md#autotls")
169
+
logger.Error("Invalid configuration, AutoTLS will be disabled: AutoTLS.AutoWSS=true requires at least one /tcp listener present in Addresses.Swarm, see https://github.com/ipfs/kubo/blob/master/docs/config.md#autotls")
logger.Fatal(fmt.Sprintf("Invalid configuration: AutoTLS.Enabled=true requires a /tcp listener ending with %q to be present in Addresses.Swarm or AutoTLS.AutoWSS=true, see https://github.com/ipfs/kubo/blob/master/docs/config.md#autotls", wssWildcard))
180
+
logger.Error(fmt.Sprintf("Invalid configuration, AutoTLS will be disabled: AutoTLS.Enabled=true requires a /tcp listener ending with %q to be present in Addresses.Swarm or AutoTLS.AutoWSS=true, see https://github.com/ipfs/kubo/blob/master/docs/config.md#autotls", wssWildcard))
181
+
enableAutoTLS=false
184
182
}
183
+
caseenableAutoTLS&&!enableTCPTransport:
184
+
logger.Error("Invalid configuration: AutoTLS.Enabled=true requires Swarm.Transports.Network.TCP to be true as well. AutoTLS will be disabled.")
185
+
enableAutoTLS=false
186
+
caseenableAutoTLS&&!enableWebsocketTransport:
187
+
logger.Error("Invalid configuration: AutoTLS.Enabled=true requires Swarm.Transports.Network.Websocket to be true as well. AutoTLS will be disabled.")
#### AutoTLS now enabled by default for nodes with 1 hour uptime
22
+
23
+
Starting now, any publicly dialable Kubo node with a `/tcp` listener that remains online for at least one hour will receive a TLS certificate through the [`AutoTLS`](https://github.com/ipfs/kubo/blob/master/docs/config.md#autotls) feature.
24
+
This occurs automatically, with no need for manual setup.
25
+
26
+
To bypass the 1-hour delay and enable AutoTLS immediately, users can explicitly opt-in by running the following commands:
27
+
28
+
```console
29
+
$ ipfs config --json AutoTLS.Enabled true
30
+
$ ipfs config --json AutoTLS.RegistrationDelay 0
31
+
```
32
+
33
+
AutoTLS will remain disabled under the following conditions:
34
+
35
+
- The node already has a manually configured `/ws` (WebSocket) listener
36
+
- A private network is in use with a `swarm.key`
37
+
- TCP or WebSocket transports are disabled, or there is no `/tcp` listener
38
+
39
+
To troubleshoot, use `GOLOG_LOG_LEVEL="error,autotls=info`.
40
+
41
+
For more details, check out the [`AutoTLS` configuration documentation](https://github.com/ipfs/kubo/blob/master/docs/config.md#autotls) or dive deeper with [AutoTLS libp2p blog post](https://blog.libp2p.io/autotls/).
42
+
20
43
#### RPC and CLI command changes
21
44
22
45
-`ipfs config` is now validating json fields ([#10679](https://github.com/ipfs/kubo/pull/10679)).
@@ -463,12 +464,7 @@ Type: `duration` (when `0`/unset, the default value is used)
463
464
464
465
## `AutoTLS`
465
466
466
-
> [!CAUTION]
467
-
> This is an **EXPERIMENTAL** opt-in feature and should not be used in production yet.
468
-
> Feel free to enable it and [report issues](https://github.com/ipfs/kubo/issues/new/choose) if you want to help with testing.
469
-
> Track progress in [kubo#10560](https://github.com/ipfs/kubo/issues/10560).
470
-
471
-
AutoTLS feature enables publicly reachable Kubo nodes (those dialable from the public
467
+
The [AutoTLS](https://blog.libp2p.io/autotls/) feature enables publicly reachable Kubo nodes (those dialable from the public
472
468
internet) to automatically obtain a wildcard TLS certificate for a DNS name
473
469
unique to their PeerID at `*.[PeerID].libp2p.direct`. This enables direct
474
470
libp2p connections and retrieval of IPFS content from browsers [Secure Context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts)
@@ -480,11 +476,11 @@ broker enabling peer to obtain a wildcard TLS certificate tied to public key of
480
476
481
477
By default, the certificates are requested from Let's Encrypt. Origin and rationale for this project can be found in [community.letsencrypt.org discussion](https://community.letsencrypt.org/t/feedback-on-raising-certificates-per-registered-domain-to-enable-peer-to-peer-networking/223003).
> This is an **EXPERIMENTAL** opt-in feature and should not be used in production yet.
498
-
> Feel free to enable it and [report issues](https://github.com/ipfs/kubo/issues/new/choose) if you want to help with testing.
499
-
> Track progress in [kubo#10560](https://github.com/ipfs/kubo/issues/10560).
492
+
Enables the AutoTLS feature to provide DNS and TLS support for [libp2p Secure WebSocket](https://github.com/libp2p/specs/blob/master/websockets/README.md) over a `/tcp` port,
493
+
to allow JS clients running in web browser [Secure Context](https://w3c.github.io/webappsec-secure-contexts/) to connect to Kubo directly.
500
494
501
-
Enables AutoTLS feature to get DNS+TLS for [libp2p Secure WebSocket](https://github.com/libp2p/specs/blob/master/websockets/README.md) on `/tcp` port.
495
+
When activated, together with [`AutoTLS.AutoWSS`](#autotlsautowss) (default) or manually including a `/tcp/{port}/tls/sni/*.libp2p.direct/ws` multiaddr in [`Addresses.Swarm`](#addressesswarm)
496
+
(with SNI suffix matching [`AutoTLS.DomainSuffix`](#autotlsdomainsuffix)), Kubo retrieves a trusted PKI TLS certificate for `*.{peerid}.libp2p.direct` and configures the `/ws` listener to use it.
502
497
503
-
If `AutoTLS.AutoWSS` is `true`, or `/tcp/../tls/sni/*.libp2p.direct/ws`[multiaddr] is present in [`Addresses.Swarm`](#addressesswarm)
504
-
with SNI segment ending with [`AutoTLS.DomainSuffix`](#autotlsdomainsuffix),
505
-
Kubo will obtain and set up a trusted PKI TLS certificate for `*.peerid.libp2p.direct`, making it dialable from web browser's [Secure Contexts](https://w3c.github.io/webappsec-secure-contexts/).
498
+
**Note:**
506
499
507
-
> [!TIP]
508
-
> - Most users don't need custom `/ws` config in `Addresses.Swarm`. Try running this with `AutoTLS.AutoWSS=true`: it will reuse preexisting catch-all `/tcp` ports that were already forwarded/safelisted on your firewall.
509
-
> - Debugging can be enabled by setting environment variable `GOLOG_LOG_LEVEL="error,autotls=debug,p2p-forge/client=debug"`. Less noisy `GOLOG_LOG_LEVEL="error,autotls=info` may be informative enough.
510
-
> - Certificates are stored in `$IPFS_PATH/p2p-forge-certs`. Removing directory and restarting daemon will trigger certificate rotation.
511
-
512
-
> [!IMPORTANT]
513
-
> Caveats:
514
-
> - Requires your Kubo node to be publicly dialable.
515
-
> - If you want to test this with a node that is behind a NAT and uses manual TCP port forwarding or UPnP (`Swarm.DisableNatPortMap=false`), use `AutoTLS.AutoWSS=true`, or manually
516
-
> add catch-all `/ip4/0.0.0.0/tcp/4001/tls/sni/*.libp2p.direct/ws` and `/ip6/::/tcp/4001/tls/sni/*.libp2p.direct/ws` to [`Addresses.Swarm`](#addressesswarm)
517
-
> and **wait 5-15 minutes** for libp2p node to set up and learn about own public addresses via [AutoNAT](#autonat).
518
-
> - If your node is fresh and just started, the [p2p-forge] client may produce and log ERRORs during this time, but once a publicly dialable addresses are set up, a subsequent retry should be successful.
519
-
> - The TLS certificate is used only for [libp2p WebSocket](https://github.com/libp2p/specs/blob/master/websockets/README.md) connections.
520
-
> - Right now, this is NOT used for hosting a [Gateway](#gateway) over HTTPS (that use case still requires manual TLS setup on reverse proxy, and your own domain).
500
+
- This feature requires a publicly reachable node. If behind NAT, manual port forwarding or UPnP (`Swarm.DisableNatPortMap=false`) is required.
501
+
- The first time AutoTLS is used, it may take 5-15 minutes + [`AutoTLS.RegistrationDelay`](#autotlsregistrationdelay) before `/ws` listener is added. Be patient.
502
+
- Avoid manual configuration. [`AutoTLS.AutoWSS=true`](#autotlsautowss) should automatically add `/ws` listener to existing, firewall-forwarded `/tcp` ports.
503
+
- To troubleshoot, use `GOLOG_LOG_LEVEL="error,autotls=debug` for detailed logs, or `GOLOG_LOG_LEVEL="error,autotls=info` for quieter output.
504
+
- Certificates are stored in `$IPFS_PATH/p2p-forge-certs`; deleting this directory and restarting the daemon forces a certificate rotation.
505
+
- For now, the TLS cert applies solely to `/ws` libp2p WebSocket connections, not HTTP [`Gateway`](#gateway), which still need separate reverse proxy TLS setup with a custom domain.
521
506
522
-
Default: `false`
507
+
Default: `true`
523
508
524
509
Type: `flag`
525
510
526
511
### `AutoTLS.AutoWSS`
527
512
528
513
Optional. Controls if Kubo should add `/tls/sni/*.libp2p.direct/ws` listener to every pre-existing `/tcp` port IFF no explicit `/ws` is defined in [`Addresses.Swarm`](#addressesswarm) already.
529
514
530
-
Default: `true` (active only if `AutoTLS.Enabled` is `true` as well)
515
+
Default: `true` (if `AutoTLS.Enabled`)
531
516
532
517
Type: `flag`
533
518
534
519
### `AutoTLS.ShortAddrs`
535
520
536
521
Optional. Controls if final AutoTLS listeners are announced under shorter `/dnsX/A.B.C.D.peerid.libp2p.direct/tcp/4001/tls/ws` addresses instead of fully resolved `/ip4/A.B.C.D/tcp/4001/tls/sni/A-B-C-D.peerid.libp2p.direct/tls/ws`.
537
522
538
-
> [!TIP]
539
-
> The main use for AutoTLS is allowing connectivity from Secure Context in a web browser, and DNS lookup needs to happen there anyway, making `/dnsX` a more compact, more interoperable option without obvious downside.
523
+
The main use for AutoTLS is allowing connectivity from Secure Context in a web browser, and DNS lookup needs to happen there anyway, making `/dnsX` a more compact, more interoperable option without obvious downside.
540
524
541
525
Default: `true`
542
526
@@ -574,6 +558,17 @@ Default: `""`
574
558
575
559
Type: `optionalString`
576
560
561
+
### `AutoTLS.RegistrationDelay`
562
+
563
+
An additional delay applied before sending a request to the `RegistrationEndpoint`.
564
+
565
+
The default delay is bypassed if the user explicitly set `AutoTLS.Enabled=true` in the JSON configuration file.
566
+
This ensures that ephemeral nodes using the default configuration do not spam the`AutoTLS.CAEndpoint` with unnecessary ACME requests.
567
+
568
+
Default: `1h` (or `0` if explicit `AutoTLS.Enabled=true`)
569
+
570
+
Type: `optionalDuration`
571
+
577
572
### `AutoTLS.CAEndpoint`
578
573
579
574
Optional override of CA ACME API used by [p2p-forge] system.
0 commit comments