File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change
1
+ // +build !go1.12
2
+
3
+ // This file can be removed once go1.11 is no longer supported
4
+
5
+ package main
6
+
7
+ import (
8
+ "crypto/tls"
9
+ "sort"
10
+ )
11
+
12
+ func mapTLSVersions (tlsVersions []string ) []int {
13
+ var versions []int
14
+ for _ , tlsVersion := range tlsVersions {
15
+ switch tlsVersion {
16
+ case "TLSv1.2" :
17
+ versions = append (versions , tls .VersionTLS12 )
18
+ case "TLSv1.1" :
19
+ versions = append (versions , tls .VersionTLS11 )
20
+ case "TLSv1" :
21
+ versions = append (versions , tls .VersionTLS10 )
22
+ case "SSLv3" :
23
+ // unsupported from go1.14
24
+ versions = append (versions , tls .VersionSSL30 )
25
+ default :
26
+ continue
27
+ }
28
+ }
29
+ sort .Ints (versions )
30
+ return versions
31
+ }
Original file line number Diff line number Diff line change 1
- // +build !go1.14
1
+ // +build go1.12, !go1.14
2
2
3
3
// This file can be removed once go1.13 is no longer supported
4
4
Original file line number Diff line number Diff line change 1
- // +build go1.14
1
+ // +build go1.14 !go1.11
2
2
3
3
// main
4
4
package main
You can’t perform that action at this time.
0 commit comments