File tree Expand file tree Collapse file tree 2 files changed +28
-13
lines changed Expand file tree Collapse file tree 2 files changed +28
-13
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,16 @@ import (
7
7
8
8
// Parameters struct defines the connection settings for wsman client.
9
9
type Parameters struct {
10
- Target string
11
- Username string
12
- Password string
13
- UseDigest bool
14
- UseTLS bool
15
- SelfSignedAllowed bool
16
- LogAMTMessages bool
17
- Transport http.RoundTripper
18
- IsRedirection bool
19
- PinnedCert string
20
- TlsConfig * tls.Config
10
+ Target string
11
+ Username string
12
+ Password string
13
+ UseDigest bool
14
+ UseTLS bool
15
+ SelfSignedAllowed bool
16
+ LogAMTMessages bool
17
+ Transport http.RoundTripper
18
+ IsRedirection bool
19
+ PinnedCert string
20
+ TlsConfig * tls.Config
21
+ AllowInsecureCipherSuites bool
21
22
}
Original file line number Diff line number Diff line change @@ -21,9 +21,8 @@ import (
21
21
"sync"
22
22
"time"
23
23
24
- "github.com/sirupsen/logrus"
25
-
26
24
"github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/amterror"
25
+ "github.com/sirupsen/logrus"
27
26
)
28
27
29
28
const (
@@ -127,6 +126,21 @@ func NewWsman(cp Parameters) *Target {
127
126
config = res .tlsConfig
128
127
} else {
129
128
config = & tls.Config {InsecureSkipVerify : cp .SelfSignedAllowed }
129
+
130
+ if cp .AllowInsecureCipherSuites {
131
+ defaultCipherSuites := tls .CipherSuites ()
132
+ config .CipherSuites = make ([]uint16 , 0 , len (defaultCipherSuites )+ 3 )
133
+
134
+ for _ , suite := range defaultCipherSuites {
135
+ config .CipherSuites = append (config .CipherSuites , suite .ID )
136
+ }
137
+ // add the weak cipher suites
138
+ config .CipherSuites = append (config .CipherSuites ,
139
+ tls .TLS_RSA_WITH_AES_128_GCM_SHA256 ,
140
+ tls .TLS_RSA_WITH_AES_128_CBC_SHA ,
141
+ tls .TLS_RSA_WITH_AES_256_CBC_SHA ,
142
+ )
143
+ }
130
144
}
131
145
}
132
146
You can’t perform that action at this time.
0 commit comments