Skip to content

Commit cd082ec

Browse files
Merge pull request #5747 from djoshy/remove-cipher-order
MCO-2147: Remove all remaining hardcoded references for TLS configuration
2 parents ad1cf27 + f0c1bc8 commit cd082ec

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

pkg/server/api.go

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -342,46 +342,3 @@ func getHTTPServerCfg(addr string, handler http.Handler, tlsConfig *tls.Config)
342342
}
343343

344344
}
345-
346-
// Disable insecure cipher suites for CVE-2016-2183
347-
// cipherOrder returns an ordered list of Ciphers that are considered secure
348-
// Deprecated ciphers are not returned.
349-
func cipherOrder() []uint16 {
350-
var first []uint16
351-
var second []uint16
352-
353-
allowable := func(c *tls.CipherSuite) bool {
354-
// Disallow block ciphers using straight SHA1
355-
// See: https://tools.ietf.org/html/rfc7540#appendix-A
356-
if strings.HasSuffix(c.Name, "CBC_SHA") {
357-
return false
358-
}
359-
// 3DES is considered insecure
360-
if strings.Contains(c.Name, "3DES") {
361-
return false
362-
}
363-
return true
364-
}
365-
366-
for _, c := range tls.CipherSuites() {
367-
for _, v := range c.SupportedVersions {
368-
if v == tls.VersionTLS13 {
369-
first = append(first, c.ID)
370-
}
371-
if v == tls.VersionTLS12 && allowable(c) {
372-
inFirst := false
373-
for _, id := range first {
374-
if c.ID == id {
375-
inFirst = true
376-
break
377-
}
378-
}
379-
if !inFirst {
380-
second = append(second, c.ID)
381-
}
382-
}
383-
}
384-
}
385-
386-
return append(first, second...)
387-
}

0 commit comments

Comments
 (0)