mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Avoid fallback to SSL protocols < TLS1.0
Signed-off-by: Tibor Vass <teabee89@gmail.com> Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh) Conflicts: registry/registry.go
This commit is contained in:
parent
7d9ccc2636
commit
8caacb18f8
3 changed files with 9 additions and 1 deletions
|
@ -1439,6 +1439,8 @@ func ListenAndServe(proto, addr string, job *engine.Job) error {
|
|||
tlsConfig := &tls.Config{
|
||||
NextProtos: []string{"http/1.1"},
|
||||
Certificates: []tls.Certificate{cert},
|
||||
// Avoid fallback on insecure SSL protocols
|
||||
MinVersion: tls.VersionTLS10,
|
||||
}
|
||||
if job.GetenvBool("TlsVerify") {
|
||||
certPool := x509.NewCertPool()
|
||||
|
|
|
@ -93,6 +93,8 @@ func main() {
|
|||
}
|
||||
tlsConfig.Certificates = []tls.Certificate{cert}
|
||||
}
|
||||
// Avoid fallback to SSL protocols < TLS1.0
|
||||
tlsConfig.MinVersion = tls.VersionTLS10
|
||||
}
|
||||
|
||||
if *flTls || *flTlsVerify {
|
||||
|
|
|
@ -37,7 +37,11 @@ const (
|
|||
)
|
||||
|
||||
func newClient(jar http.CookieJar, roots *x509.CertPool, cert *tls.Certificate, timeout TimeoutType, secure bool) *http.Client {
|
||||
tlsConfig := tls.Config{RootCAs: roots}
|
||||
tlsConfig := tls.Config{
|
||||
RootCAs: roots,
|
||||
// Avoid fallback to SSL protocols < TLS1.0
|
||||
MinVersion: tls.VersionTLS10,
|
||||
}
|
||||
|
||||
if cert != nil {
|
||||
tlsConfig.Certificates = append(tlsConfig.Certificates, *cert)
|
||||
|
|
Loading…
Reference in a new issue