Skip to content

Commit dde1b40

Browse files
authored
Merge pull request #108 from SenseUnit/tls_fallback_roots
tls: embed fallback certs
2 parents 1b58096 + 1a887b2 commit dde1b40

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,17 @@ WORKDIR /go/src/github.com/SenseUnit/dumbproxy
66
COPY . .
77
ARG TARGETOS TARGETARCH
88
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC"
9-
ADD https://curl.haxx.se/ca/cacert.pem /certs.crt
10-
RUN chmod 0644 /certs.crt
119
RUN mkdir /.dumbproxy
1210

1311
FROM scratch AS scratch
1412
COPY --from=build /go/src/github.com/SenseUnit/dumbproxy/dumbproxy /
15-
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
1613
COPY --from=build --chown=9999:9999 /.dumbproxy /.dumbproxy
1714
USER 9999:9999
1815
EXPOSE 8080/tcp
1916
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
2017

2118
FROM alpine AS alpine
2219
COPY --from=build /go/src/github.com/SenseUnit/dumbproxy/dumbproxy /
23-
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
2420
COPY --from=build --chown=9999:9999 /.dumbproxy /.dumbproxy
2521
RUN apk add --no-cache tzdata
2622
USER 9999:9999

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ require (
1818
golang.org/x/time v0.8.0
1919
)
2020

21+
require golang.org/x/crypto/x509roots/fallback v0.0.0-20250406160420-959f8f3db0fb
22+
2123
require (
2224
github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5 // indirect
2325
github.com/cespare/xxhash/v2 v2.2.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
5252
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
5353
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
5454
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
55+
golang.org/x/crypto/x509roots/fallback v0.0.0-20250406160420-959f8f3db0fb h1:Iu0p/klM0SM7atONioa/bPhLS7cjhnip99x1OIGibwg=
56+
golang.org/x/crypto/x509roots/fallback v0.0.0-20250406160420-959f8f3db0fb/go.mod h1:lxN5T34bK4Z/i6cMaU7frUU57VkDXFD4Kamfl/cp9oU=
5557
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
5658
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
5759
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=

main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import (
3838
"github.com/SenseUnit/dumbproxy/handler"
3939
clog "github.com/SenseUnit/dumbproxy/log"
4040
proxyproto "github.com/pires/go-proxyproto"
41+
42+
_ "golang.org/x/crypto/x509roots/fallback"
4143
)
4244

4345
var (

0 commit comments

Comments
 (0)