Skip to content

Commit 068a1ea

Browse files
authored
fix: only enable safe cipher suites for tls v1.2 (#2540)
1 parent 0033861 commit 068a1ea

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

cmd/api/src/daemons/api/bhapi/api.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package bhapi
1818

1919
import (
2020
"context"
21+
"crypto/tls"
2122
"errors"
2223
"fmt"
2324
"log"
@@ -41,6 +42,14 @@ func NewDaemon(cfg config.Configuration, handler http.Handler) Daemon {
4142
Addr: cfg.BindAddress,
4243
Handler: handler,
4344
ErrorLog: log.Default(),
45+
TLSConfig: &tls.Config{
46+
MinVersion: tls.VersionTLS12,
47+
CipherSuites: []uint16{
48+
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
49+
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
50+
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
51+
},
52+
},
4453
},
4554
}
4655
}

cmd/api/src/daemons/api/toolapi/api.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package toolapi
1818

1919
import (
2020
"context"
21+
"crypto/tls"
2122
"errors"
2223
"fmt"
2324
"log"
@@ -110,6 +111,14 @@ func NewDaemon[DBType database.Database](ctx context.Context, connections bootst
110111
Addr: cfg.MetricsPort,
111112
Handler: router,
112113
ErrorLog: log.Default(),
114+
TLSConfig: &tls.Config{
115+
MinVersion: tls.VersionTLS12,
116+
CipherSuites: []uint16{
117+
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
118+
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
119+
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
120+
},
121+
},
113122
},
114123
}
115124
}

0 commit comments

Comments
 (0)