Skip to content

Commit 21ba935

Browse files
set http version explicitly to remove http2 support (#121)
* set http version explicitly to remove http2 support
1 parent 48e2527 commit 21ba935

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Updated vault api lib to v1.1.1 to try to resolve dependabot resolution
1616
issues.
1717
* Change build test exceptions declaration (linting).
18+
* Explicitly set http1.1 for service.
1819

1920
### Security
2021
* Updated argo-workflows to v3.1.8 to address CVE-2021-37914

service/main.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package main
55

66
import (
7+
"crypto/tls"
78
"fmt"
89
"net/http"
910
"os"
@@ -87,7 +88,18 @@ func main() {
8788
level.Info(logger).Log("message", "starting web service", "vault addr", env.VaultAddress, "argoAddr", env.ArgoAddress)
8889

8990
r := setupRouter(h)
90-
err = http.ListenAndServeTLS(fmt.Sprintf(":%d", env.Port), "ssl/certificate.crt", "ssl/certificate.key", r)
91+
srv := &http.Server{
92+
Addr: fmt.Sprintf(":%d", env.Port),
93+
Handler: r,
94+
TLSConfig: &tls.Config{
95+
MinVersion: tls.VersionTLS12,
96+
NextProtos: []string{
97+
"http/1.1",
98+
},
99+
},
100+
}
101+
102+
err = srv.ListenAndServeTLS("ssl/certificate.crt", "ssl/certificate.key")
91103
if err != nil {
92104
level.Error(logger).Log("message", "error starting service", "error", err)
93105
panic("error starting service")

0 commit comments

Comments
 (0)