File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 # builtin_all lints every built-in at once; GOOS is swept by `make lint`.
44 build-tags :
55 - builtin_all
6+ - embedca
67linters :
78 enable :
89 - protogetter
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ TRIMPATH ?= 1
99UPX ?= 0
1010EXTRA_MIN ?= 0
1111BUILTIN ?= all
12+ # EMBED_CA=1 embeds the Mozilla root bundle (build tag embedca), used only
13+ # when the system has no CA store. For images without ca-certificates.
14+ EMBED_CA ?= 0
1215# Empty selects the per-platform default from the internal/wg build constraints:
1316# wgcli on freebsd, wgctrl elsewhere. Set to override.
1417BACKEND ?=
@@ -49,9 +52,14 @@ ifeq ($(BUILTIN),all)
4952 override BUILTIN := builtin_all
5053endif
5154
52- # Combine BUILTIN and BACKEND tags. An empty BACKEND adds no tag, leaving the
53- # backend choice to the build constraints in internal/wg.
54- ALL_TAGS := $(strip $(BUILTIN ) $(BACKEND ) )
55+ CA_TAG =
56+ ifneq ($(EMBED_CA ) ,0)
57+ CA_TAG := embedca
58+ endif
59+
60+ # Combine BUILTIN, BACKEND and EMBED_CA tags. An empty BACKEND adds no tag,
61+ # leaving the backend choice to the build constraints in internal/wg.
62+ ALL_TAGS := $(strip $(BUILTIN ) $(BACKEND ) $(CA_TAG ) )
5563TAGS_FLAGS = $(if $(ALL_TAGS ) ,-tags '$(ALL_TAGS ) ',)
5664
5765UPX_TARGET =
Original file line number Diff line number Diff line change 1+ //go:build embedca
2+
3+ package main
4+
5+ // The embedded Mozilla roots activate only when the system provides no
6+ // certificate store, so HTTPS plugins work on minimal images (e.g. OpenWrt
7+ // before 21.02, bare buildroot) without a ca-certificates package.
8+ import _ "golang.org/x/crypto/x509roots/fallback"
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ require (
1111 go.uber.org/mock v0.6.0
1212 go.yaml.in/yaml/v3 v3.0.4
1313 golang.org/x/crypto v0.54.0
14+ golang.org/x/crypto/x509roots/fallback v0.0.0-20260723152544-d701c51f7e4e
1415 golang.org/x/net v0.57.0
1516 golang.zx2c4.com/wireguard/wgctrl v0.0.0-20241231184526-a9ab2273dd10
1617)
Original file line number Diff line number Diff line change @@ -60,6 +60,8 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
6060go.yaml.in/yaml/v3 v3.0.4 /go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg =
6161golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw =
6262golang.org/x/crypto v0.54.0 /go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk =
63+ golang.org/x/crypto/x509roots/fallback v0.0.0-20260723152544-d701c51f7e4e h1:9TjMDOuGaMMTP5f7GXeHeA0JvFqGmv4DYRIWkzoePGI =
64+ golang.org/x/crypto/x509roots/fallback v0.0.0-20260723152544-d701c51f7e4e /go.mod h1:+UoQFNBq2p2wO+Q6ddVtYc25GZ6VNdOMyyrd4nrqrKs =
6365golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE =
6466golang.org/x/net v0.57.0 /go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU =
6567golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek =
You can’t perform that action at this time.
0 commit comments