File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,15 @@ COPY *.go ./
1313
1414ARG TARGETOS TARGETARCH
1515RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o lk-jwt-service
16+ # set up nsswitch.conf for Go's "netgo" implementation
17+ # - https://github.com/golang/go/blob/go1.24.0/src/net/conf.go#L343
18+ RUN echo 'hosts: files dns' > /etc/nsswitch.conf
1619
1720FROM scratch
1821
1922COPY --from=builder /proj/lk-jwt-service /lk-jwt-service
2023COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
24+ COPY --from=builder /etc/nsswitch.conf /etc/nsswitch.conf
2125
2226EXPOSE 8080
2327
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
2323"log"
2424"net/http"
2525"os"
26+ "crypto/tls"
2627
2728"time"
2829
@@ -64,6 +65,8 @@ func exchangeOIDCToken(
6465
6566if skipVerifyTLS {
6667log .Printf ("!!! WARNING !!! Skipping TLS verification for matrix client connection to %s" , token .MatrixServerName )
68+ // Disable TLS verification on the default HTTP Transport for the well-known lookup
69+ http .DefaultTransport .(* http.Transport ).TLSClientConfig = & tls.Config { InsecureSkipVerify : true }
6770}
6871client := fclient .NewClient (fclient .WithWellKnownSRVLookups (true ), fclient .WithSkipVerify (skipVerifyTLS ))
6972
You can’t perform that action at this time.
0 commit comments