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 (
77
88// Parameters struct defines the connection settings for wsman client.
99type 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
2122}
Original file line number Diff line number Diff line change @@ -21,9 +21,8 @@ import (
2121 "sync"
2222 "time"
2323
24- "github.com/sirupsen/logrus"
25-
2624 "github.com/open-amt-cloud-toolkit/go-wsman-messages/v2/pkg/amterror"
25+ "github.com/sirupsen/logrus"
2726)
2827
2928const (
@@ -127,6 +126,21 @@ func NewWsman(cp Parameters) *Target {
127126 config = res .tlsConfig
128127 } else {
129128 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+ }
130144 }
131145 }
132146
You can’t perform that action at this time.
0 commit comments