Skip to content

Commit 8588aa9

Browse files
committed
Remove TLS support
We don't need this for now. It was only added recently to the CTFE and got ported over here. In an effort to splify this binary to its bare minimum, let's remove this for now. We can always add it back later if required.
1 parent f18d190 commit 8588aa9

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

cmd/gcp/main.go

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package main
1717

1818
import (
1919
"context"
20-
"crypto/tls"
2120
"flag"
2221
"fmt"
2322
"net/http"
@@ -52,8 +51,6 @@ var (
5251
notAfterLimit timestampFlag
5352

5453
httpEndpoint = flag.String("http_endpoint", "localhost:6962", "Endpoint for HTTP (host:port).")
55-
tlsCert = flag.String("tls_certificate", "", "Path to server TLS certificate.")
56-
tlsKey = flag.String("tls_key", "", "Path to server TLS private key.")
5754
metricsEndpoint = flag.String("metrics_endpoint", "", "Endpoint for serving metrics; if left empty, metrics will be visible on --http_endpoint.")
5855
tesseraDeadline = flag.Duration("tessera_deadline", time.Second*10, "Deadline for Tessera requests.")
5956
maskInternalErrors = flag.Bool("mask_internal_errors", false, "Don't return error strings with Internal Server Error HTTP responses.")
@@ -165,20 +162,7 @@ func main() {
165162
}
166163

167164
// Bring up the HTTP server and serve until we get a signal not to.
168-
srv := http.Server{}
169-
if *tlsCert != "" && *tlsKey != "" {
170-
cert, err := tls.LoadX509KeyPair(*tlsCert, *tlsKey)
171-
if err != nil {
172-
klog.Errorf("failed to load TLS certificate/key: %v", err)
173-
}
174-
tlsConfig := &tls.Config{
175-
Certificates: []tls.Certificate{cert},
176-
MinVersion: tls.VersionTLS12,
177-
}
178-
srv = http.Server{Addr: *httpEndpoint, Handler: handler, TLSConfig: tlsConfig}
179-
} else {
180-
srv = http.Server{Addr: *httpEndpoint, Handler: handler}
181-
}
165+
srv := http.Server{Addr: *httpEndpoint, Handler: handler}
182166
shutdownWG := new(sync.WaitGroup)
183167
go awaitSignal(func() {
184168
shutdownWG.Add(1)
@@ -194,14 +178,7 @@ func main() {
194178
klog.Info("HTTP server shutdown")
195179
})
196180

197-
if *tlsCert != "" && *tlsKey != "" {
198-
err = srv.ListenAndServeTLS("", "")
199-
} else {
200-
err = srv.ListenAndServe()
201-
}
202-
if err != http.ErrServerClosed {
203-
klog.Warningf("Server exited: %v", err)
204-
}
181+
err = srv.ListenAndServe()
205182
// Wait will only block if the function passed to awaitSignal was called,
206183
// in which case it'll block until the HTTP server has gracefully shutdown
207184
shutdownWG.Wait()

0 commit comments

Comments
 (0)