OLD | NEW |
1 package config_test | 1 package config_test |
2 | 2 |
3 import ( | 3 import ( |
4 "io/ioutil" | 4 "io/ioutil" |
5 . "launchpad.net/gocheck" | 5 . "launchpad.net/gocheck" |
6 "launchpad.net/juju-core/environs/config" | 6 "launchpad.net/juju-core/environs/config" |
| 7 "launchpad.net/juju-core/testing" |
7 "launchpad.net/juju-core/version" | 8 "launchpad.net/juju-core/version" |
8 "os" | 9 "os" |
9 "path/filepath" | 10 "path/filepath" |
10 » "testing" | 11 » stdtesting "testing" |
11 ) | 12 ) |
12 | 13 |
13 func Test(t *testing.T) { | 14 func Test(t *stdtesting.T) { |
14 TestingT(t) | 15 TestingT(t) |
15 } | 16 } |
16 | 17 |
17 type ConfigSuite struct { | 18 type ConfigSuite struct { |
| 19 testing.LoggingSuite |
18 home string | 20 home string |
19 } | 21 } |
20 | 22 |
21 var _ = Suite(&ConfigSuite{}) | 23 var _ = Suite(&ConfigSuite{}) |
22 | 24 |
23 type attrs map[string]interface{} | 25 type attrs map[string]interface{} |
24 | 26 |
25 func (s *ConfigSuite) SetUpSuite(c *C) { | |
26 } | |
27 | |
28 var configTests = []struct { | 27 var configTests = []struct { |
| 28 about string |
29 attrs map[string]interface{} | 29 attrs map[string]interface{} |
30 err string | 30 err string |
31 }{ | 31 }{ |
32 { | 32 { |
33 » » // The minimum good configuration. | 33 » » about: "The minimum good configuration", |
34 » » attrs{ | 34 » » attrs: attrs{ |
35 "type": "my-type", | 35 "type": "my-type", |
36 "name": "my-name", | 36 "name": "my-name", |
37 }, | 37 }, |
38 » » "", | 38 » }, { |
39 » }, { | 39 » » about: "Explicit series", |
40 » » // Explicit series. | 40 » » attrs: attrs{ |
41 » » attrs{ | |
42 "type": "my-type", | 41 "type": "my-type", |
43 "name": "my-name", | 42 "name": "my-name", |
44 "default-series": "my-series", | 43 "default-series": "my-series", |
45 }, | 44 }, |
46 » » "", | 45 » }, { |
47 » }, { | 46 » » about: "Implicit series with empty value", |
48 » » // Implicit series with empty value. | 47 » » attrs: attrs{ |
49 » » attrs{ | |
50 "type": "my-type", | 48 "type": "my-type", |
51 "name": "my-name", | 49 "name": "my-name", |
52 "default-series": "", | 50 "default-series": "", |
53 }, | 51 }, |
54 » » "", | 52 » }, { |
55 » }, { | 53 » » about: "Explicit authorized-keys", |
56 » » // Explicit authorized-keys. | 54 » » attrs: attrs{ |
57 » » attrs{ | 55 » » » "type": "my-type", |
58 » » » "type": "my-type", | 56 » » » "name": "my-name", |
59 » » » "name": "my-name", | 57 » » » "authorized-keys": "my-keys", |
60 » » » "authorized-keys": "my-keys", | 58 » » }, |
61 » » }, | 59 » }, { |
62 » » "", | 60 » » about: "Load authorized-keys from path", |
63 » }, { | 61 » » attrs: attrs{ |
64 » » // Load authorized-keys from path. | |
65 » » attrs{ | |
66 "type": "my-type", | 62 "type": "my-type", |
67 "name": "my-name", | 63 "name": "my-name", |
68 "authorized-keys-path": "~/.ssh/authorized_keys2", | 64 "authorized-keys-path": "~/.ssh/authorized_keys2", |
69 }, | 65 }, |
70 » » "", | 66 » }, { |
71 » }, { | 67 » » about: "Root cert & key from path", |
72 » » attrs{ | 68 » » attrs: attrs{ |
| 69 » » » "type": "my-type", |
| 70 » » » "name": "my-name", |
| 71 » » » "ca-cert-path": "cacert2.pem", |
| 72 » » » "ca-private-key-path": "cakey2.pem", |
| 73 » » }, |
| 74 » }, { |
| 75 » » about: "Root cert & key from ~ path", |
| 76 » » attrs: attrs{ |
| 77 » » » "type": "my-type", |
| 78 » » » "name": "my-name", |
| 79 » » » "ca-cert-path": "~/othercert.pem", |
| 80 » » » "ca-private-key-path": "~/otherkey.pem", |
| 81 » » }, |
| 82 » }, { |
| 83 » » about: "Root cert only from ~ path", |
| 84 » » attrs: attrs{ |
| 85 » » » "type": "my-type", |
| 86 » » » "name": "my-name", |
| 87 » » » "ca-cert-path": "~/othercert.pem", |
| 88 » » » "ca-private-key": "", |
| 89 » » }, |
| 90 » }, { |
| 91 » » about: "Root cert only as attribute", |
| 92 » » attrs: attrs{ |
| 93 » » » "type": "my-type", |
| 94 » » » "name": "my-name", |
| 95 » » » "ca-cert": caCert, |
| 96 » » » "ca-private-key": "", |
| 97 » » }, |
| 98 » }, { |
| 99 » » about: "Root cert and key as attributes", |
| 100 » » attrs: attrs{ |
| 101 » » » "type": "my-type", |
| 102 » » » "name": "my-name", |
| 103 » » » "ca-cert": caCert, |
| 104 » » » "ca-private-key": caKey, |
| 105 » » }, |
| 106 » }, { |
| 107 » » about: "Mismatched CA cert and key", |
| 108 » » attrs: attrs{ |
| 109 » » » "type": "my-type", |
| 110 » » » "name": "my-name", |
| 111 » » » "ca-cert": caCert, |
| 112 » » » "ca-private-key": caKey2, |
| 113 » » }, |
| 114 » » err: "bad CA certificate/key in configuration: crypto/tls: priva
te key does not match public key", |
| 115 » }, { |
| 116 » » about: "Invalid CA cert", |
| 117 » » attrs: attrs{ |
| 118 » » » "type": "my-type", |
| 119 » » » "name": "my-name", |
| 120 » » » "ca-cert": invalidCACert, |
| 121 » » }, |
| 122 » » err: "bad CA certificate/key in configuration: ASN.1 syntax erro
r:.*", |
| 123 » }, { |
| 124 » » about: "Invalid CA key", |
| 125 » » attrs: attrs{ |
| 126 » » » "type": "my-type", |
| 127 » » » "name": "my-name", |
| 128 » » » "ca-cert": caCert, |
| 129 » » » "ca-private-key": invalidCAKey, |
| 130 » » }, |
| 131 » » err: "bad CA certificate/key in configuration: crypto/tls: faile
d to parse key:.*", |
| 132 » }, { |
| 133 » » about: "No PEM cert", |
| 134 » » attrs: attrs{ |
| 135 » » » "type": "my-type", |
| 136 » » » "name": "my-name", |
| 137 » » » "ca-cert": "foo", |
| 138 » » » "ca-private-key": "", |
| 139 » » }, |
| 140 » » err: "bad CA certificate/key in configuration: no certificates f
ound", |
| 141 » }, { |
| 142 » » about: "Specified agent version", |
| 143 » » attrs: attrs{ |
73 "type": "my-type", | 144 "type": "my-type", |
74 "name": "my-name", | 145 "name": "my-name", |
75 "authorized-keys": "my-keys", | 146 "authorized-keys": "my-keys", |
76 "agent-version": "1.2.3", | 147 "agent-version": "1.2.3", |
77 }, | 148 }, |
78 » » "", | 149 » }, { |
79 » }, { | 150 » » about: "Specified development flag", |
80 » » attrs{ | 151 » » attrs: attrs{ |
81 "type": "my-type", | 152 "type": "my-type", |
82 "name": "my-name", | 153 "name": "my-name", |
83 "authorized-keys": "my-keys", | 154 "authorized-keys": "my-keys", |
84 "development": true, | 155 "development": true, |
85 }, | 156 }, |
86 » » "", | 157 » }, { |
87 » }, { | 158 » » about: "Specified admin secret", |
88 » » attrs{ | 159 » » attrs: attrs{ |
89 "type": "my-type", | 160 "type": "my-type", |
90 "name": "my-name", | 161 "name": "my-name", |
91 "authorized-keys": "my-keys", | 162 "authorized-keys": "my-keys", |
92 "development": false, | 163 "development": false, |
93 "admin-secret": "pork", | 164 "admin-secret": "pork", |
94 }, | 165 }, |
95 » » "", | 166 » }, { |
96 » }, { | 167 » » about: "Invalid development flag", |
97 » » attrs{ | 168 » » attrs: attrs{ |
98 "type": "my-type", | 169 "type": "my-type", |
99 "name": "my-name", | 170 "name": "my-name", |
100 "authorized-keys": "my-keys", | 171 "authorized-keys": "my-keys", |
101 "development": "true", | 172 "development": "true", |
102 }, | 173 }, |
103 » » "development: expected bool, got \"true\"", | 174 » » err: "development: expected bool, got \"true\"", |
104 » }, { | 175 » }, { |
105 » » attrs{ | 176 » » about: "Invalid agent version", |
| 177 » » attrs: attrs{ |
106 "type": "my-type", | 178 "type": "my-type", |
107 "name": "my-name", | 179 "name": "my-name", |
108 "authorized-keys": "my-keys", | 180 "authorized-keys": "my-keys", |
109 "agent-version": "2", | 181 "agent-version": "2", |
110 }, | 182 }, |
111 » » `invalid agent version in environment configuration: "2"`, | 183 » » err: `invalid agent version in environment configuration: "2"`, |
112 » }, { | 184 » }, { |
113 » » attrs{ | 185 » » about: "Missing type", |
| 186 » » attrs: attrs{ |
114 "name": "my-name", | 187 "name": "my-name", |
115 }, | 188 }, |
116 » » "type: expected string, got nothing", | 189 » » err: "type: expected string, got nothing", |
117 » }, { | 190 » }, { |
118 » » attrs{ | 191 » » about: "Empty type", |
| 192 » » attrs: attrs{ |
119 "name": "my-name", | 193 "name": "my-name", |
120 "type": "", | 194 "type": "", |
121 }, | 195 }, |
122 » » "empty type in environment configuration", | 196 » » err: "empty type in environment configuration", |
123 » }, { | 197 » }, { |
124 » » attrs{ | 198 » » about: "Missing name", |
125 » » » "type": "my-type", | 199 » » attrs: attrs{ |
126 » » }, | 200 » » » "type": "my-type", |
127 » » "name: expected string, got nothing", | 201 » » }, |
128 » }, { | 202 » » err: "name: expected string, got nothing", |
129 » » attrs{ | 203 » }, { |
| 204 » » about: "Bad name", |
| 205 » » attrs: attrs{ |
| 206 » » » "name": "foo/bar", |
| 207 » » » "type": "my-type", |
| 208 » » }, |
| 209 » » err: "environment name contains unsafe characters", |
| 210 » }, { |
| 211 » » about: "Empty name", |
| 212 » » attrs: attrs{ |
130 "type": "my-type", | 213 "type": "my-type", |
131 "name": "", | 214 "name": "", |
132 }, | 215 }, |
133 » » "empty name in environment configuration", | 216 » » err: "empty name in environment configuration", |
134 » }, { | 217 » }, { |
135 » » // Default firewall mode. | 218 » » about: "Default firewall mode", |
136 » » attrs{ | 219 » » attrs: attrs{ |
137 "type": "my-type", | 220 "type": "my-type", |
138 "name": "my-name", | 221 "name": "my-name", |
139 "firewall-mode": config.FwDefault, | 222 "firewall-mode": config.FwDefault, |
140 }, | 223 }, |
141 » » "", | 224 » }, { |
142 » }, { | 225 » » about: "Instance firewall mode", |
143 » » // Instance firewall mode. | 226 » » attrs: attrs{ |
144 » » attrs{ | |
145 "type": "my-type", | 227 "type": "my-type", |
146 "name": "my-name", | 228 "name": "my-name", |
147 "firewall-mode": config.FwInstance, | 229 "firewall-mode": config.FwInstance, |
148 }, | 230 }, |
149 » » "", | 231 » }, { |
150 » }, { | 232 » » about: "Global firewall mode", |
151 » » // Global firewall mode. | 233 » » attrs: attrs{ |
152 » » attrs{ | |
153 "type": "my-type", | 234 "type": "my-type", |
154 "name": "my-name", | 235 "name": "my-name", |
155 "firewall-mode": config.FwGlobal, | 236 "firewall-mode": config.FwGlobal, |
156 }, | 237 }, |
157 » » "", | 238 » }, { |
158 » }, { | 239 » » about: "Illegal firewall mode", |
159 » » // Illegal firewall mode. | 240 » » attrs: attrs{ |
160 » » attrs{ | |
161 "type": "my-type", | 241 "type": "my-type", |
162 "name": "my-name", | 242 "name": "my-name", |
163 "firewall-mode": "illegal", | 243 "firewall-mode": "illegal", |
164 }, | 244 }, |
165 » » "invalid firewall mode in environment configuration: .*", | 245 » » err: "invalid firewall mode in environment configuration: .*", |
166 }, | 246 }, |
167 } | 247 } |
168 | 248 |
| 249 var configTestFiles = []struct { |
| 250 name, data string |
| 251 }{ |
| 252 {".ssh/id_dsa.pub", "dsa"}, |
| 253 {".ssh/id_rsa.pub", "rsa\n"}, |
| 254 {".ssh/identity.pub", "identity"}, |
| 255 {".ssh/authorized_keys", "auth0\n# first\nauth1\n\n"}, |
| 256 {".ssh/authorized_keys2", "auth2\nauth3\n"}, |
| 257 |
| 258 {".juju/my-name-cert.pem", caCert}, |
| 259 {".juju/my-name-private-key.pem", caKey}, |
| 260 {".juju/cacert2.pem", caCert2}, |
| 261 {".juju/cakey2.pem", caKey2}, |
| 262 {"othercert.pem", caCert3}, |
| 263 {"otherkey.pem", caKey3}, |
| 264 } |
| 265 |
169 func (*ConfigSuite) TestConfig(c *C) { | 266 func (*ConfigSuite) TestConfig(c *C) { |
170 » homedir := c.MkDir() | 267 » homeDir := filepath.Join(c.MkDir(), "me") |
171 » sshdir := filepath.Join(homedir, ".ssh") | |
172 | |
173 defer os.Setenv("HOME", os.Getenv("HOME")) | 268 defer os.Setenv("HOME", os.Getenv("HOME")) |
174 » os.Setenv("HOME", homedir) | 269 » os.Setenv("HOME", homeDir) |
175 | 270 |
176 » err := os.Mkdir(sshdir, 0777) | 271 » for _, f := range configTestFiles { |
177 » c.Assert(err, IsNil) | 272 » » path := filepath.Join(homeDir, f.name) |
178 | 273 » » err := os.MkdirAll(filepath.Dir(path), 0700) |
179 » kfiles := []struct{ name, data string }{ | 274 » » c.Assert(err, IsNil) |
180 » » {"id_dsa.pub", "dsa"}, | 275 » » err = ioutil.WriteFile(path, []byte(f.data), 0666) |
181 » » {"id_rsa.pub", "rsa\n"}, | |
182 » » {"identity.pub", "identity"}, | |
183 » » {"authorized_keys", "auth0\n# first\nauth1\n\n"}, | |
184 » » {"authorized_keys2", "auth2\nauth3\n"}, | |
185 » } | |
186 » for _, kf := range kfiles { | |
187 » » err = ioutil.WriteFile(filepath.Join(sshdir, kf.name), []byte(kf
.data), 0666) | |
188 c.Assert(err, IsNil) | 276 c.Assert(err, IsNil) |
189 } | 277 } |
190 | 278 |
191 for i, test := range configTests { | 279 for i, test := range configTests { |
192 » » c.Logf("test %d", i) | 280 » » c.Logf("test %d. %s", i, test.about) |
| 281 |
193 cfg, err := config.New(test.attrs) | 282 cfg, err := config.New(test.attrs) |
194 if test.err != "" { | 283 if test.err != "" { |
195 c.Assert(err, ErrorMatches, test.err) | 284 c.Assert(err, ErrorMatches, test.err) |
196 continue | 285 continue |
197 } else if err != nil { | |
198 c.Fatalf("error with config %#v: %v", test.attrs, err) | |
199 } | 286 } |
| 287 c.Assert(err, IsNil) |
200 | 288 |
201 typ, _ := test.attrs["type"].(string) | 289 typ, _ := test.attrs["type"].(string) |
202 name, _ := test.attrs["name"].(string) | 290 name, _ := test.attrs["name"].(string) |
203 c.Assert(cfg.Type(), Equals, typ) | 291 c.Assert(cfg.Type(), Equals, typ) |
204 c.Assert(cfg.Name(), Equals, name) | 292 c.Assert(cfg.Name(), Equals, name) |
205 if s := test.attrs["agent-version"]; s != nil { | 293 if s := test.attrs["agent-version"]; s != nil { |
206 vers, err := version.Parse(s.(string)) | 294 vers, err := version.Parse(s.(string)) |
207 c.Assert(err, IsNil) | 295 c.Assert(err, IsNil) |
208 c.Assert(cfg.AgentVersion(), Equals, vers) | 296 c.Assert(cfg.AgentVersion(), Equals, vers) |
209 } else { | 297 } else { |
(...skipping 11 matching lines...) Expand all Loading... |
221 | 309 |
222 if m, _ := test.attrs["firewall-mode"].(string); m != "" { | 310 if m, _ := test.attrs["firewall-mode"].(string); m != "" { |
223 c.Assert(cfg.FirewallMode(), Equals, config.FirewallMode
(m)) | 311 c.Assert(cfg.FirewallMode(), Equals, config.FirewallMode
(m)) |
224 } | 312 } |
225 | 313 |
226 if secret, _ := test.attrs["admin-secret"].(string); secret != "
" { | 314 if secret, _ := test.attrs["admin-secret"].(string); secret != "
" { |
227 c.Assert(cfg.AdminSecret(), Equals, secret) | 315 c.Assert(cfg.AdminSecret(), Equals, secret) |
228 } | 316 } |
229 | 317 |
230 if path, _ := test.attrs["authorized-keys-path"].(string); path
!= "" { | 318 if path, _ := test.attrs["authorized-keys-path"].(string); path
!= "" { |
231 » » » for _, kf := range kfiles { | 319 » » » c.Assert(cfg.AuthorizedKeys(), Equals, fileContents(c, p
ath)) |
232 » » » » if kf.name == filepath.Base(path) { | |
233 » » » » » c.Assert(cfg.AuthorizedKeys(), Equals, k
f.data) | |
234 » » » » » path = "" | |
235 » » » » » break | |
236 » » » » } | |
237 » » » } | |
238 » » » if path != "" { | |
239 » » » » c.Fatalf("authorized-keys-path refers to unknown
test file: %s", path) | |
240 » » » } | |
241 c.Assert(cfg.AllAttrs()["authorized-keys-path"], Equals,
nil) | 320 c.Assert(cfg.AllAttrs()["authorized-keys-path"], Equals,
nil) |
242 } else if keys, _ := test.attrs["authorized-keys"].(string); key
s != "" { | 321 } else if keys, _ := test.attrs["authorized-keys"].(string); key
s != "" { |
243 c.Assert(cfg.AuthorizedKeys(), Equals, keys) | 322 c.Assert(cfg.AuthorizedKeys(), Equals, keys) |
244 } else { | 323 } else { |
245 // Content of all the files that are read by default. | 324 // Content of all the files that are read by default. |
246 want := "dsa\nrsa\nidentity\n" | 325 want := "dsa\nrsa\nidentity\n" |
247 c.Assert(cfg.AuthorizedKeys(), Equals, want) | 326 c.Assert(cfg.AuthorizedKeys(), Equals, want) |
248 } | 327 } |
| 328 |
| 329 if path, _ := test.attrs["ca-cert-path"].(string); path != "" { |
| 330 c.Assert(cfg.CACertPEM(), Equals, fileContents(c, path)) |
| 331 } else if test.attrs["ca-cert"] != nil { |
| 332 c.Assert(cfg.CACertPEM(), Equals, test.attrs["ca-cert"]) |
| 333 } else { |
| 334 c.Assert(cfg.CACertPEM(), Equals, caCert) |
| 335 } |
| 336 |
| 337 if path, _ := test.attrs["ca-private-key-path"].(string); path !
= "" { |
| 338 c.Assert(cfg.CAPrivateKeyPEM(), Equals, fileContents(c,
path)) |
| 339 } else if k, ok := test.attrs["ca-private-key"]; ok { |
| 340 c.Assert(cfg.CAPrivateKeyPEM(), Equals, k) |
| 341 } else { |
| 342 c.Assert(cfg.CAPrivateKeyPEM(), Equals, caKey) |
| 343 } |
249 } | 344 } |
250 } | 345 } |
251 | 346 |
| 347 // fileContents returns the test file contents for the |
| 348 // given specified path (which may be relative, so |
| 349 // we compare with the base filename only). |
| 350 func fileContents(c *C, path string) string { |
| 351 for _, f := range configTestFiles { |
| 352 if filepath.Base(f.name) == filepath.Base(path) { |
| 353 return f.data |
| 354 } |
| 355 } |
| 356 c.Fatalf("path attribute holds unknown test file: %q", path) |
| 357 panic("unreachable") |
| 358 } |
| 359 |
252 func (*ConfigSuite) TestConfigAttrs(c *C) { | 360 func (*ConfigSuite) TestConfigAttrs(c *C) { |
253 attrs := map[string]interface{}{ | 361 attrs := map[string]interface{}{ |
254 "type": "my-type", | 362 "type": "my-type", |
255 "name": "my-name", | 363 "name": "my-name", |
256 "authorized-keys": "my-keys", | 364 "authorized-keys": "my-keys", |
257 "firewall-mode": string(config.FwDefault), | 365 "firewall-mode": string(config.FwDefault), |
258 "default-series": version.Current.Series, | 366 "default-series": version.Current.Series, |
259 "admin-secret": "foo", | 367 "admin-secret": "foo", |
260 "unknown": "my-unknown", | 368 "unknown": "my-unknown", |
| 369 "ca-private-key": "", |
| 370 "ca-cert": caCert, |
261 } | 371 } |
262 cfg, err := config.New(attrs) | 372 cfg, err := config.New(attrs) |
263 c.Assert(err, IsNil) | 373 c.Assert(err, IsNil) |
264 | 374 |
265 attrs["development"] = false // This attribute is added if not set. | 375 attrs["development"] = false // This attribute is added if not set. |
266 c.Assert(cfg.AllAttrs(), DeepEquals, attrs) | 376 c.Assert(cfg.AllAttrs(), DeepEquals, attrs) |
267 c.Assert(cfg.UnknownAttrs(), DeepEquals, map[string]interface{}{"unknown
": "my-unknown"}) | 377 c.Assert(cfg.UnknownAttrs(), DeepEquals, map[string]interface{}{"unknown
": "my-unknown"}) |
268 | 378 |
269 newcfg, err := cfg.Apply(map[string]interface{}{ | 379 newcfg, err := cfg.Apply(map[string]interface{}{ |
270 "name": "new-name", | 380 "name": "new-name", |
271 "new-unknown": "my-new-unknown", | 381 "new-unknown": "my-new-unknown", |
272 }) | 382 }) |
273 | 383 |
274 attrs["name"] = "new-name" | 384 attrs["name"] = "new-name" |
275 attrs["new-unknown"] = "my-new-unknown" | 385 attrs["new-unknown"] = "my-new-unknown" |
276 c.Assert(newcfg.AllAttrs(), DeepEquals, attrs) | 386 c.Assert(newcfg.AllAttrs(), DeepEquals, attrs) |
277 } | 387 } |
| 388 |
| 389 var caCert = ` |
| 390 -----BEGIN CERTIFICATE----- |
| 391 MIIBjDCCATigAwIBAgIBADALBgkqhkiG9w0BAQUwHjENMAsGA1UEChMEanVqdTEN |
| 392 MAsGA1UEAxMEcm9vdDAeFw0xMjExMDkxNjQwMjhaFw0yMjExMDkxNjQ1MjhaMB4x |
| 393 DTALBgNVBAoTBGp1anUxDTALBgNVBAMTBHJvb3QwWTALBgkqhkiG9w0BAQEDSgAw |
| 394 RwJAduA1Gnb2VJLxNGfG4St0Qy48Y3q5Z5HheGtTGmti/FjlvQvScCFGCnJG7fKA |
| 395 Knd7ia3vWg7lxYkIvMPVP88LAQIDAQABo2YwZDAOBgNVHQ8BAf8EBAMCAKQwEgYD |
| 396 VR0TAQH/BAgwBgEB/wIBATAdBgNVHQ4EFgQUlvKX8vwp0o+VdhdhoA9O6KlOm00w |
| 397 HwYDVR0jBBgwFoAUlvKX8vwp0o+VdhdhoA9O6KlOm00wCwYJKoZIhvcNAQEFA0EA |
| 398 LlNpevtFr8gngjAFFAO/FXc7KiZcCrA5rBfb/rEy297lIqmKt5++aVbLEPyxCIFC |
| 399 r71Sj63TUTFWtRZAxvn9qQ== |
| 400 -----END CERTIFICATE----- |
| 401 `[1:] |
| 402 |
| 403 var caKey = ` |
| 404 -----BEGIN RSA PRIVATE KEY----- |
| 405 MIIBOQIBAAJAduA1Gnb2VJLxNGfG4St0Qy48Y3q5Z5HheGtTGmti/FjlvQvScCFG |
| 406 CnJG7fKAKnd7ia3vWg7lxYkIvMPVP88LAQIDAQABAkEAsFOdMSYn+AcF1M/iBfjo |
| 407 uQWJ+Zz+CgwuvumjGNsUtmwxjA+hh0fCn0Ah2nAt4Ma81vKOKOdQ8W6bapvsVDH0 |
| 408 6QIhAJOkLmEKm4H5POQV7qunRbRsLbft/n/SHlOBz165WFvPAiEAzh9fMf70std1 |
| 409 sVCHJRQWKK+vw3oaEvPKvkPiV5ui0C8CIGNsvybuo8ald5IKCw5huRlFeIxSo36k |
| 410 m3OVCXc6zfwVAiBnTUe7WcivPNZqOC6TAZ8dYvdWo4Ifz3jjpEfymjid1wIgBIJv |
| 411 ERPyv2NQqIFQZIyzUP7LVRIWfpFFOo9/Ww/7s5Y= |
| 412 -----END RSA PRIVATE KEY----- |
| 413 `[1:] |
| 414 |
| 415 var caCert2 = ` |
| 416 -----BEGIN CERTIFICATE----- |
| 417 MIIBjTCCATmgAwIBAgIBADALBgkqhkiG9w0BAQUwHjENMAsGA1UEChMEanVqdTEN |
| 418 MAsGA1UEAxMEcm9vdDAeFw0xMjExMDkxNjQxMDhaFw0yMjExMDkxNjQ2MDhaMB4x |
| 419 DTALBgNVBAoTBGp1anUxDTALBgNVBAMTBHJvb3QwWjALBgkqhkiG9w0BAQEDSwAw |
| 420 SAJBAJkSWRrr81y8pY4dbNgt+8miSKg4z6glp2KO2NnxxAhyyNtQHKvC+fJALJj+ |
| 421 C2NhuvOv9xImxOl3Hg8fFPCXCtcCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgCkMBIG |
| 422 A1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFOsX/ZCqKzWCAaTTVcWsWKT5Msow |
| 423 MB8GA1UdIwQYMBaAFOsX/ZCqKzWCAaTTVcWsWKT5MsowMAsGCSqGSIb3DQEBBQNB |
| 424 AAVV57jetEzJQnjgBzhvx/UwauFn78jGhXfV5BrQmxIb4SF4DgSCFstPwUQOAr8h |
| 425 XXzJqBQH92KYmp+y3YXDoMQ= |
| 426 -----END CERTIFICATE----- |
| 427 `[1:] |
| 428 |
| 429 var caKey2 = ` |
| 430 -----BEGIN RSA PRIVATE KEY----- |
| 431 MIIBOQIBAAJBAJkSWRrr81y8pY4dbNgt+8miSKg4z6glp2KO2NnxxAhyyNtQHKvC |
| 432 +fJALJj+C2NhuvOv9xImxOl3Hg8fFPCXCtcCAwEAAQJATQNzO11NQvJS5U6eraFt |
| 433 FgSFQ8XZjILtVWQDbJv8AjdbEgKMHEy33icsAKIUAx8jL9kjq6K9kTdAKXZi9grF |
| 434 UQIhAPD7jccIDUVm785E5eR9eisq0+xpgUIa24Jkn8cAlst5AiEAopxVFl1auer3 |
| 435 GP2In3pjdL4ydzU/gcRcYisoJqwHpM8CIHtqmaXBPeq5WT9ukb5/dL3+5SJCtmxA |
| 436 jQMuvZWRe6khAiBvMztYtPSDKXRbCZ4xeQ+kWSDHtok8Y5zNoTeu4nvDrwIgb3Al |
| 437 fikzPveC5g6S6OvEQmyDz59tYBubm2XHgvxqww0= |
| 438 -----END RSA PRIVATE KEY----- |
| 439 `[1:] |
| 440 |
| 441 var caCert3 = ` |
| 442 -----BEGIN CERTIFICATE----- |
| 443 MIIBjTCCATmgAwIBAgIBADALBgkqhkiG9w0BAQUwHjENMAsGA1UEChMEanVqdTEN |
| 444 MAsGA1UEAxMEcm9vdDAeFw0xMjExMDkxNjQxMjlaFw0yMjExMDkxNjQ2MjlaMB4x |
| 445 DTALBgNVBAoTBGp1anUxDTALBgNVBAMTBHJvb3QwWjALBgkqhkiG9w0BAQEDSwAw |
| 446 SAJBAIW7CbHFJivvV9V6mO8AGzJS9lqjUf6MdEPsdF6wx2Cpzr/lSFIggCwRA138 |
| 447 9MuFxflxb/3U8Nq+rd8rVtTgFMECAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgCkMBIG |
| 448 A1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFJafrxqByMN9BwGfcmuF0Lw/1QII |
| 449 MB8GA1UdIwQYMBaAFJafrxqByMN9BwGfcmuF0Lw/1QIIMAsGCSqGSIb3DQEBBQNB |
| 450 AHq3vqNhxya3s33DlQfSj9whsnqM0Nm+u8mBX/T76TF5rV7+B33XmYzSyfA3yBi/ |
| 451 zHaUR/dbHuiNTO+KXs3/+Y4= |
| 452 -----END CERTIFICATE----- |
| 453 `[1:] |
| 454 |
| 455 var caKey3 = ` |
| 456 -----BEGIN RSA PRIVATE KEY----- |
| 457 MIIBOgIBAAJBAIW7CbHFJivvV9V6mO8AGzJS9lqjUf6MdEPsdF6wx2Cpzr/lSFIg |
| 458 gCwRA1389MuFxflxb/3U8Nq+rd8rVtTgFMECAwEAAQJAaivPi4qJPrJb2onl50H/ |
| 459 VZnWKqmljGF4YQDWduMEt7GTPk+76x9SpO7W4gfY490Ivd9DEXfbr/KZqhwWikNw |
| 460 LQIhALlLfRXLF2ZfToMfB1v1v+jith5onAu24O68mkdRc5PLAiEAuMJ/6U07hggr |
| 461 Ckf9OT93wh84DK66h780HJ/FUHKcoCMCIDsPZaJBpoa50BOZG0ZjcTTwti3BGCPf |
| 462 uZg+w0oCGz27AiEAsUCYKqEXy/ymHhT2kSecozYENdajyXvcaOG3EPkD3nUCICOP |
| 463 zatzs7c/4mx4a0JBG6Za0oEPUcm2I34is50KSohz |
| 464 -----END RSA PRIVATE KEY----- |
| 465 `[1:] |
| 466 |
| 467 var invalidCAKey = ` |
| 468 -----BEGIN RSA PRIVATE KEY----- |
| 469 MIIBOgIBAAJAZabKgKInuOxj5vDWLwHHQtK3/45KB+32D15w94Nt83BmuGxo90lw |
| 470 -----END RSA PRIVATE KEY----- |
| 471 `[1:] |
| 472 |
| 473 var invalidCACert = ` |
| 474 -----BEGIN CERTIFICATE----- |
| 475 MIIBOgIBAAJAZabKgKInuOxj5vDWLwHHQtK3/45KB+32D15w94Nt83BmuGxo90lw |
| 476 -----END CERTIFICATE----- |
| 477 `[1:] |
OLD | NEW |