mongo 2.9.0.rc0 → 2.9.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +1 -3
  5. data/lib/mongo/client.rb +33 -16
  6. data/lib/mongo/collection/view/aggregation.rb +3 -2
  7. data/lib/mongo/collection/view/map_reduce.rb +3 -2
  8. data/lib/mongo/server/connectable.rb +8 -4
  9. data/lib/mongo/server/connection.rb +0 -1
  10. data/lib/mongo/server/monitor/connection.rb +0 -1
  11. data/lib/mongo/socket/ssl.rb +67 -10
  12. data/lib/mongo/version.rb +1 -1
  13. data/spec/README.md +39 -3
  14. data/spec/integration/auth_spec.rb +2 -2
  15. data/spec/integration/ssl_uri_options_spec.rb +7 -6
  16. data/spec/lite_spec_helper.rb +0 -16
  17. data/spec/mongo/client_construction_spec.rb +13 -13
  18. data/spec/mongo/collection/view/map_reduce_spec.rb +8 -0
  19. data/spec/mongo/server_spec.rb +2 -1
  20. data/spec/mongo/socket/ssl_spec.rb +213 -20
  21. data/spec/mongo/socket/tcp_spec.rb +1 -1
  22. data/spec/support/certificates/README.md +101 -0
  23. data/spec/support/certificates/ca.crt +76 -0
  24. data/spec/support/certificates/{client_key_encrypted.pem → client-encrypted.key} +0 -0
  25. data/spec/support/certificates/client-int.crt +78 -0
  26. data/spec/support/certificates/client-second-level-bundle.pem +179 -0
  27. data/spec/support/certificates/client-second-level.crt +74 -0
  28. data/spec/support/certificates/client-second-level.key +27 -0
  29. data/spec/support/certificates/client-second-level.pem +101 -0
  30. data/spec/support/certificates/client.crt +74 -0
  31. data/spec/support/certificates/{client_key.pem → client.key} +1 -1
  32. data/spec/support/certificates/client.pem +1 -1
  33. data/spec/support/certificates/multi-ca.crt +152 -0
  34. data/spec/support/certificates/python-ca.crt +76 -0
  35. data/spec/support/certificates/server-int.crt +78 -0
  36. data/spec/support/certificates/server-second-level-bundle.pem +179 -0
  37. data/spec/support/certificates/server-second-level.crt +74 -0
  38. data/spec/support/certificates/server-second-level.key +27 -0
  39. data/spec/support/certificates/server-second-level.pem +101 -0
  40. data/spec/support/certificates/server.pem +74 -22
  41. data/spec/support/constraints.rb +3 -7
  42. data/spec/support/spec_config.rb +84 -16
  43. metadata +36 -10
  44. metadata.gz.sig +0 -0
  45. data/spec/support/certificates/ca.pem +0 -22
  46. data/spec/support/certificates/client_cert.pem +0 -22
@@ -0,0 +1,74 @@
1
+ Certificate:
2
+ Data:
3
+ Version: 3 (0x2)
4
+ Serial Number: 403728 (0x62910)
5
+ Signature Algorithm: sha256WithRSAEncryption
6
+ Issuer: CN = intermediate-server, OU = Ruby Driver, O = MongoDB, L = New York City, ST = New York, C = US
7
+ Validity
8
+ Not Before: May 30 22:28:04 2019 GMT
9
+ Not After : May 30 22:28:04 2039 GMT
10
+ Subject: CN = localhost, OU = Ruby Driver, O = MongoDB, L = New York City, ST = New York, C = US
11
+ Subject Public Key Info:
12
+ Public Key Algorithm: rsaEncryption
13
+ RSA Public-Key: (2048 bit)
14
+ Modulus:
15
+ 00:94:9a:50:f9:bc:68:39:68:e3:54:1d:48:d9:83:
16
+ b7:7f:8c:59:cd:54:8d:ba:af:13:ef:25:a5:9d:c4:
17
+ d6:0a:f4:10:c4:ee:e7:b5:60:81:83:5f:3f:88:bd:
18
+ 63:d7:39:68:8d:2b:d6:85:a8:f6:4a:6e:52:6c:f1:
19
+ 03:71:a7:2e:2f:e2:80:6a:c3:5a:94:7a:70:2c:5f:
20
+ a1:ea:17:e5:db:54:24:75:d3:3a:8d:83:22:96:76:
21
+ 21:9f:b5:51:ff:b8:4d:33:b8:6c:39:bb:68:98:71:
22
+ 50:b5:41:67:bd:f5:76:f8:49:1e:58:fe:d7:a4:54:
23
+ c1:15:25:b1:24:2f:20:ea:56:a4:29:2f:83:f4:c2:
24
+ a9:13:12:a1:f3:9b:9e:95:6d:25:c4:bf:d9:74:0f:
25
+ d3:1f:7a:87:f7:a8:f8:82:8b:0d:4f:e8:5b:6e:32:
26
+ 00:e0:e8:8a:35:91:75:82:56:37:7f:f5:ab:5d:0f:
27
+ 7f:b9:61:62:13:e4:38:44:f8:3b:58:f9:87:23:6a:
28
+ aa:79:cf:6b:df:52:2b:40:0c:4d:12:b0:84:ac:40:
29
+ f3:6e:f1:0f:37:23:f0:54:7c:f5:e3:b8:0b:20:77:
30
+ 27:ef:7f:2a:bf:20:ee:06:50:25:0b:42:57:1a:45:
31
+ ca:a2:65:71:e1:bf:5d:f1:79:6f:66:3d:22:28:b9:
32
+ d9:93
33
+ Exponent: 65537 (0x10001)
34
+ X509v3 extensions:
35
+ X509v3 Subject Alternative Name:
36
+ DNS:localhost, IP Address:127.0.0.1
37
+ Signature Algorithm: sha256WithRSAEncryption
38
+ 8a:2d:64:a3:92:30:31:8c:b8:50:8d:20:9f:24:e9:62:8f:98:
39
+ e4:6b:4b:75:3b:90:fb:51:b3:65:79:a8:5f:ac:fc:57:f1:ca:
40
+ 34:72:6b:07:37:82:d0:b8:89:a4:6d:eb:4a:2e:c5:7c:f6:eb:
41
+ bf:40:84:5d:56:0c:77:c8:79:f6:28:6c:86:50:ad:0b:d4:99:
42
+ 58:ec:da:b3:ad:e0:55:93:b6:be:2f:4a:29:dd:4c:f4:41:85:
43
+ 41:59:ba:3f:0a:3d:ce:c5:66:c6:41:c6:b0:94:f5:f9:f9:e9:
44
+ ff:85:c4:df:f7:36:33:7e:80:fc:b6:89:cc:d8:72:c8:2f:ae:
45
+ 49:80:c7:65:c2:ec:5b:31:c1:ed:da:76:39:92:bf:cb:d9:8a:
46
+ ef:44:7c:a3:e3:ae:db:17:19:4d:7e:4e:e5:61:09:bc:18:b8:
47
+ c4:09:b7:46:d8:0f:f9:6f:d8:60:ec:ec:a5:51:28:a7:06:83:
48
+ bd:5d:39:76:aa:26:cc:b1:d0:ac:f4:ad:88:40:0d:8b:73:32:
49
+ 62:a8:5e:47:12:99:6c:a1:6a:25:a3:f4:62:45:5e:89:36:d4:
50
+ 17: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ohvZYmhm1HAuYWuUvphquFrOXCxuycAvgcaXQBKR0L
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,101 @@
1
+ Certificate:
2
+ Data:
3
+ Version: 3 (0x2)
4
+ Serial Number: 403728 (0x62910)
5
+ Signature Algorithm: sha256WithRSAEncryption
6
+ Issuer: CN = intermediate-server, OU = Ruby Driver, O = MongoDB, L = New York City, ST = New York, C = US
7
+ Validity
8
+ Not Before: May 30 22:28:04 2019 GMT
9
+ Not After : May 30 22:28:04 2039 GMT
10
+ Subject: CN = localhost, OU = Ruby Driver, O = MongoDB, L = New York City, ST = New York, C = US
11
+ Subject Public Key Info:
12
+ Public Key Algorithm: rsaEncryption
13
+ RSA Public-Key: (2048 bit)
14
+ Modulus:
15
+ 00:94:9a:50:f9:bc:68:39:68:e3:54:1d:48:d9:83:
16
+ b7:7f:8c:59:cd:54:8d:ba:af:13:ef:25:a5:9d:c4:
17
+ d6:0a:f4:10:c4:ee:e7:b5:60:81:83:5f:3f:88:bd:
18
+ 63:d7:39:68:8d:2b:d6:85:a8:f6:4a:6e:52:6c:f1:
19
+ 03:71:a7:2e:2f:e2:80:6a:c3:5a:94:7a:70:2c:5f:
20
+ a1:ea:17:e5:db:54:24:75:d3:3a:8d:83:22:96:76:
21
+ 21:9f:b5:51:ff:b8:4d:33:b8:6c:39:bb:68:98:71:
22
+ 50:b5:41:67:bd:f5:76:f8:49:1e:58:fe:d7:a4:54:
23
+ c1:15:25:b1:24:2f:20:ea:56:a4:29:2f:83:f4:c2:
24
+ a9:13:12:a1:f3:9b:9e:95:6d:25:c4:bf:d9:74:0f:
25
+ d3:1f:7a:87:f7:a8:f8:82:8b:0d:4f:e8:5b:6e:32:
26
+ 00:e0:e8:8a:35:91:75:82:56:37:7f:f5:ab:5d:0f:
27
+ 7f:b9:61:62:13:e4:38:44:f8:3b:58:f9:87:23:6a:
28
+ aa:79:cf:6b:df:52:2b:40:0c:4d:12:b0:84:ac:40:
29
+ f3:6e:f1:0f:37:23:f0:54:7c:f5:e3:b8:0b:20:77:
30
+ 27:ef:7f:2a:bf:20:ee:06:50:25:0b:42:57:1a:45:
31
+ ca:a2:65:71:e1:bf:5d:f1:79:6f:66:3d:22:28:b9:
32
+ d9:93
33
+ Exponent: 65537 (0x10001)
34
+ X509v3 extensions:
35
+ X509v3 Subject Alternative Name:
36
+ DNS:localhost, IP Address:127.0.0.1
37
+ Signature Algorithm: sha256WithRSAEncryption
38
+ 8a:2d:64:a3:92:30:31:8c:b8:50:8d:20:9f:24:e9:62:8f:98:
39
+ e4:6b:4b:75:3b:90:fb:51:b3:65:79:a8:5f:ac:fc:57:f1:ca:
40
+ 34:72:6b:07:37:82:d0:b8:89:a4:6d:eb:4a:2e:c5:7c:f6:eb:
41
+ bf:40:84:5d:56:0c:77:c8:79:f6:28:6c:86:50:ad:0b:d4:99:
42
+ 58:ec:da:b3:ad:e0:55:93:b6:be:2f:4a:29:dd:4c:f4:41:85:
43
+ 41:59:ba:3f:0a:3d:ce:c5:66:c6:41:c6:b0:94:f5:f9:f9:e9:
44
+ ff:85:c4:df:f7:36:33:7e:80:fc:b6:89:cc:d8:72:c8:2f:ae:
45
+ 49:80:c7:65:c2:ec:5b:31:c1:ed:da:76:39:92:bf:cb:d9:8a:
46
+ ef:44:7c:a3:e3:ae:db:17:19:4d:7e:4e:e5:61:09:bc:18:b8:
47
+ c4:09:b7:46:d8:0f:f9:6f:d8:60:ec:ec:a5:51:28:a7:06:83:
48
+ bd:5d:39:76:aa:26:cc:b1:d0:ac:f4:ad:88:40:0d:8b:73:32:
49
+ 62:a8:5e:47:12:99:6c:a1:6a:25:a3:f4:62:45:5e:89:36:d4:
50
+ 17:ed:e4:54:cf:1d:6a:67:19:67:eb:4e:64:83:7b:5b:67:e4:
51
+ a4:e5:26:1d:0e:56:4f:7f:b7:32:19:44:85:fe:ba:ae:58:d4:
52
+ e3:ed:a5:71
53
+ -----BEGIN CERTIFICATE-----
54
+ MIIDjTCCAnWgAwIBAgIDBikQM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iufE+4cB5+rXjmYIlTMs0x6KHunZr0XpRlMPv
88
+ y4upZQ+O4eo5rrEc0nAaHP/XvNfcogYzyy4qg7DrGl2Px4+iuoGvj5o/0wILZ2Hy
89
+ ZnWlmJiMctn9Z+MUhMNfLxjEzSly3Y+nZkMYLzNoIgdcqk9jjnw2d3lvAoGBAKnF
90
+ CsY7LNySixPHHAfCQt3rkEEvPQMMPStNp6ct84StYJyCGyOUyjLBjcBrq4/tOc/D
91
+ fpoJDBUMUJj9yrVp3he3x00cXAoneX2ED4jnNMMPm84blr02hSCwU/1ldyKDm34/
92
+ OXlym0UF0nYB2f3hrrwBTic5y2L90PdGfBUD5GgdAoGAcO2gIeCkbEoauXLkypOq
93
+ KdpPY0MkpdYucWpUAbDtY6jKlR5wHp7GscfYypJzgBs50sB3vU8rtjP/U7o5XW7U
94
+ wptiatLRIr3HELgtzhWwBUiNCsa8fzwuLrQZxydg6kMvC93XWq6piY4E5xKgXjk6
95
+ 7C1P/FRKcfNdUU0XDbpVU7kCgYBWsbu1zSQ0o1UITYZf4/D3mMK6tt/GParDAU3b
96
+ DpkrqMoMQliPi/zRfIvhtloPDoqWMXPmPzZ/TSGfbwLkL2Lt47iQBSpvOQdOdHDm
97
+ bYNBFShwUSBiEYRcVA8f+H+lDWYLS0gTX9Ywoi9+eaWTg3sSoOwDFf1p2MmsbL8S
98
+ kEFEdQKBgCmc/NESy29MO3j8tH63UbdmD7BeHA36KNmRFzosE9O62eM5xcWsUeE0
99
+ Xd1vC0V8R9J4sF7ZcwfI9q/XW5I6wW4aKWlwCa1yx7A39Ea9UjiASmY7+hx3vn0z
100
+ 4XAfT1HvR2ohvZYmhm1HAuYWuUvphquFrOXCxuycAvgcaXQBKR0L
101
+ -----END RSA PRIVATE KEY-----
@@ -1,3 +1,77 @@
1
+ Certificate:
2
+ Data:
3
+ Version: 3 (0x2)
4
+ Serial Number: 210471 (0x33627)
5
+ Signature Algorithm: sha256WithRSAEncryption
6
+ Issuer: CN = Ruby Driver CA, OU = Drivers, O = MongoDB, L = New York City, ST = New York, C = US
7
+ Validity
8
+ Not Before: Feb 14 20:57:50 2019 GMT
9
+ Not After : Feb 14 20:57:50 2039 GMT
10
+ Subject: CN = localhost, OU = Drivers, O = MongoDB, L = New York City, ST = New York, C = US
11
+ Subject Public Key Info:
12
+ Public Key Algorithm: rsaEncryption
13
+ RSA Public-Key: (2048 bit)
14
+ Modulus:
15
+ 00:d3:29:70:81:e1:41:92:c0:cc:9b:92:0c:a9:17:
16
+ 02:95:2e:55:0d:80:f3:2e:5d:27:24:db:4f:a6:6a:
17
+ a9:ce:66:bd:4e:7c:eb:01:04:28:68:11:40:39:0e:
18
+ ff:67:ba:4c:fe:05:7f:cb:e1:37:33:36:1e:a4:ee:
19
+ 62:02:6b:a6:d1:b3:24:de:a5:1f:34:1c:b2:f1:c8:
20
+ 04:09:09:fe:28:e0:23:ef:7d:47:1b:55:b5:ce:41:
21
+ 0d:4a:55:3c:65:19:f1:c5:56:69:d3:17:1a:cc:43:
22
+ 26:23:22:d3:f8:0c:85:21:9b:6e:fd:9e:bb:b1:19:
23
+ db:d8:10:74:7b:0f:f2:c6:b3:0a:d0:83:c6:48:c3:
24
+ 99:71:f8:49:cf:f3:99:5b:eb:a1:c0:e9:6c:e8:a6:
25
+ 84:ac:2e:1f:56:c2:1f:02:90:be:5e:ee:b7:b5:7d:
26
+ 9b:5f:c2:76:23:c0:d8:8d:1b:52:f7:0d:21:1e:aa:
27
+ 22:08:48:2f:ce:b4:a2:d4:92:fa:58:14:35:77:b2:
28
+ 20:9e:52:b6:32:7b:b0:8a:49:33:83:52:57:ba:8e:
29
+ d9:12:8a:4d:54:f3:0e:26:c2:8b:c9:28:83:1a:34:
30
+ a1:a1:ee:b8:47:1e:d4:9d:b4:2e:90:15:c1:ef:a3:
31
+ c6:9f:7b:2d:37:08:8b:3a:4a:f5:25:58:87:60:7f:
32
+ d7:ab
33
+ Exponent: 65537 (0x10001)
34
+ X509v3 extensions:
35
+ X509v3 Subject Alternative Name:
36
+ DNS:localhost, IP Address:127.0.0.1, IP Address:0:0:0:0:0:0:0:1
37
+ Signature Algorithm: sha256WithRSAEncryption
38
+ 83:4c:55:bb:f9:09:c9:db:6e:ca:2b:91:36:78:f9:2e:26:5a:
39
+ b0:4f:1b:2c:61:45:dc:c8:3b:7c:3d:31:b5:78:01:a1:07:2c:
40
+ c6:d4:05:d9:61:d2:23:74:89:0c:50:8c:a1:86:94:a9:95:4c:
41
+ 0e:01:3d:60:3e:5a:79:24:09:41:80:63:59:d4:b1:85:bf:2e:
42
+ c3:f0:e8:40:b4:56:01:1f:4b:79:69:f1:54:f9:97:b9:46:b5:
43
+ 6f:d1:56:a0:f1:de:5f:7e:03:61:53:ff:6a:fc:b3:d6:ea:ab:
44
+ 80:1c:24:89:a1:64:41:62:53:50:f1:74:02:36:04:22:37:8a:
45
+ d8:10:85:af:6b:3a:00:34:d6:13:7a:2e:de:24:ed:ef:e7:7f:
46
+ ac:f9:12:70:8e:d7:b2:5b:c1:ab:5a:9d:7d:8a:76:e9:9c:54:
47
+ 4e:6d:ed:41:d5:00:bf:14:b9:d1:1a:d0:42:81:ab:04:1f:84:
48
+ 0d:ba:f8:40:eb:b8:88:40:82:75:2d:9e:94:51:e3:fb:21:b0:
49
+ 9a:55:9e:84:b4:5e:a7:e3:cb:b3:6c:0c:15:56:af:7d:6e:ad:
50
+ 13:90:29:30:c7:ed:68:3f:b3:9e:ae:3c:30:e1:8b:39:3a:41:
51
+ 42:24:34:76:90:49:d6:51:3d:ee:86:85:3d:fb:dd:e1:f2:37:
52
+ a3:13:c1:e5
53
+ -----BEGIN CERTIFICATE-----
54
+ MIIDkjCCAnqgAwIBAgIDAzYnMA0GCSqGSIb3DQEBCwUAMHUxFzAVBgNVBAMTDlJ1
55
+ YnkgRHJpdmVyIENBMRAwDgYDVQQLEwdEcml2ZXJzMRAwDgYDVQQKEwdNb25nb0RC
56
+ MRYwFAYDVQQHEw1OZXcgWW9yayBDaXR5MREwDwYD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6E
72
+ tF6n48uzbAwVVq99bq0TkCkwx+1oP7Oerjww4Ys5OkFCJDR2kEnWUT3uhoU9+93h
73
+ 8jejE8Hl
74
+ -----END CERTIFICATE-----
1
75
  -----BEGIN RSA PRIVATE KEY-----
2
76
  MIIEpAIBAAKCAQEA0ylwgeFBksDMm5IMqRcClS5VDYDzLl0nJNtPpmqpzma9Tnzr
3
77
  AQQoaBFAOQ7/Z7pM/gV/y+E3MzYepO5iAmum0bMk3qUfNByy8cgECQn+KOAj731H
@@ -25,25 +99,3 @@ vYiXowKBgQDVcwEyiBFY2sdwMQJ8jyHwJxcGzp7M2eDfbBOXhA2vnMM0M2J1PyxR
25
99
  VM9cElyyX5/KsdnmIRCa/GpTm5Fuuua9pG3geB2z+Gxq+9wccc/72MQfX1GoYWc8
26
100
  StVxFy3oAncFNiXtgew++P/8ANZiABBXU4aG13iLJotQkXjO2okqBA==
27
101
  -----END RSA PRIVATE KEY-----
28
- -----BEGIN CERTIFICATE-----
29
- MIIDkjCCAnqgAwIBAgIDAzYnMA0GCSqGSIb3DQEBCwUAMHUxFzAVBgNVBAMTDlJ1
30
- YnkgRHJpdmVyIENBMRAwDgYDVQQLEwdEcml2ZXJzMRAwDgYDVQQKEwdNb25nb0RC
31
- MRYwFAYDVQQHEw1OZXcgWW9yayBDaXR5MREwDwYDVQQIEwhOZXcgWW9yazELMAkG
32
- A1UEBhMCVVMwHhcNMTkwMjE0MjA1NzUwWhcNMzkwMjE0MjA1NzUwWjBwMRIwEAYD
33
- VQQDEwlsb2NhbGhvc3QxEDAOBgNVBAsTB0RyaXZlcnMxEDAOBgNVBAoTB01vbmdv
34
- REIxFjAUBgNVBAcTDU5ldyBZb3JrIENpdHkxETAPBgNVBAgTCE5ldyBZb3JrMQsw
35
- CQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANMpcIHh
36
- QZLAzJuSDKkXApUuVQ2A8y5dJyTbT6Zqqc5mvU586wEEKGgRQDkO/2e6TP4Ff8vh
37
- NzM2HqTuYgJrptGzJN6lHzQcsvHIBAkJ/ijgI+99RxtVtc5BDUpVPGUZ8cVWadMX
38
- GsxDJiMi0/gMhSGbbv2eu7EZ29gQdHsP8sazCtCDxkjDmXH4Sc/zmVvrocDpbOim
39
- hKwuH1bCHwKQvl7ut7V9m1/CdiPA2I0bUvcNIR6qIghIL860otSS+lgUNXeyIJ5S
40
- tjJ7sIpJM4NSV7qO2RKKTVTzDibCi8kogxo0oaHuuEce1J20LpAVwe+jxp97LTcI
41
- izpK9SVYh2B/16sCAwEAAaMwMC4wLAYDVR0RBCUwI4IJbG9jYWxob3N0hwR/AAAB
42
- hxAAAAAAAAAAAAAAAAAAAAABMA0GCSqGSIb3DQEBCwUAA4IBAQCDTFW7+QnJ227K
43
- K5E2ePkuJlqwTxssYUXcyDt8PTG1eAGhByzG1AXZYdIjdIkMUIyhhpSplUwOAT1g
44
- Plp5JAlBgGNZ1LGFvy7D8OhAtFYBH0t5afFU+Ze5RrVv0Vag8d5ffgNhU/9q/LPW
45
- 6quAHCSJoWRBYlNQ8XQCNgQiN4rYEIWvazoANNYTei7eJO3v53+s+RJwjteyW8Gr
46
- Wp19inbpnFRObe1B1QC/FLnRGtBCgasEH4QNuvhA67iIQIJ1LZ6UUeP7IbCaVZ6E
47
- tF6n48uzbAwVVq99bq0TkCkwx+1oP7Oerjww4Ys5OkFCJDR2kEnWUT3uhoU9+93h
48
- 8jejE8Hl
49
- -----END CERTIFICATE-----
@@ -72,7 +72,7 @@ module Constraints
72
72
  require_topology :replica_set
73
73
  end
74
74
 
75
- def require_ssl
75
+ def require_tls
76
76
  before do
77
77
  unless SpecConfig.instance.ssl?
78
78
  skip "SSL not enabled"
@@ -80,7 +80,7 @@ module Constraints
80
80
  end
81
81
  end
82
82
 
83
- def require_no_ssl
83
+ def require_no_tls
84
84
  before do
85
85
  if SpecConfig.instance.ssl?
86
86
  skip "SSL enabled"
@@ -89,11 +89,7 @@ module Constraints
89
89
  end
90
90
 
91
91
  def require_local_tls
92
- before do
93
- unless SpecConfig.instance.ssl? && !SpecConfig.instance.ci?
94
- skip 'Not running locally with TLS enabled'
95
- end
96
- end
92
+ require_tls
97
93
  end
98
94
 
99
95
  def require_no_retry_writes
@@ -4,6 +4,7 @@ class SpecConfig
4
4
  include Singleton
5
5
 
6
6
  def initialize
7
+ @uri_options = {}
7
8
  if ENV['MONGODB_URI']
8
9
  @mongodb_uri = Mongo::URI.new(ENV['MONGODB_URI'])
9
10
  @uri_options = Mongo::Options::Mapper.transform_keys_to_symbols(@mongodb_uri.uri_options)
@@ -37,6 +38,14 @@ class SpecConfig
37
38
  end
38
39
  end
39
40
 
41
+ @uri_tls_options = {}
42
+ @uri_options.each do |k, v|
43
+ k = k.to_s.downcase
44
+ if k.start_with?('ssl')
45
+ @uri_tls_options[k] = v
46
+ end
47
+ end
48
+
40
49
  if @addresses.nil?
41
50
  # Discover deployment topology
42
51
  if @mongodb_uri
@@ -188,33 +197,91 @@ EOT
188
197
  end
189
198
 
190
199
  def ssl_certs_dir
191
- "#{spec_root}/support/certificates"
200
+ Pathname.new("#{spec_root}/support/certificates")
192
201
  end
193
202
 
194
- def client_cert_pem
195
- if drivers_tools?
196
- ENV['DRIVER_TOOLS_CLIENT_CERT_PEM']
203
+ # TLS certificates & keys
204
+
205
+ def local_client_key_path
206
+ "#{ssl_certs_dir}/client.key"
207
+ end
208
+
209
+ def client_key_path
210
+ if drivers_tools? && ENV['DRIVER_TOOLS_CLIENT_KEY_PEM']
211
+ ENV['DRIVER_TOOLS_CLIENT_KEY_PEM']
197
212
  else
198
- "#{ssl_certs_dir}/client_cert.pem"
213
+ local_client_key_path
199
214
  end
200
215
  end
201
216
 
202
- def client_key_pem
203
- if drivers_tools?
204
- ENV['DRIVER_TOOLS_CLIENT_KEY_PEM']
217
+ def local_client_cert_path
218
+ "#{ssl_certs_dir}/client.crt"
219
+ end
220
+
221
+ def client_cert_path
222
+ if drivers_tools? && ENV['DRIVER_TOOLS_CLIENT_CERT_PEM']
223
+ ENV['DRIVER_TOOLS_CLIENT_CERT_PEM']
205
224
  else
206
- "#{ssl_certs_dir}/client_key.pem"
225
+ local_client_cert_path
207
226
  end
208
227
  end
209
228
 
210
- def client_cert_key_pem
211
- if drivers_tools?
229
+ def local_client_pem_path
230
+ "#{ssl_certs_dir}/client.pem"
231
+ end
232
+
233
+ def client_pem_path
234
+ if drivers_tools? && ENV['DRIVER_TOOLS_CLIENT_CERT_KEY_PEM']
212
235
  ENV['DRIVER_TOOLS_CLIENT_CERT_KEY_PEM']
213
236
  else
214
- "#{ssl_certs_dir}/client.pem"
237
+ local_client_pem_path
238
+ end
239
+ end
240
+
241
+ def second_level_cert_path
242
+ "#{ssl_certs_dir}/client-second-level.crt"
243
+ end
244
+
245
+ def second_level_key_path
246
+ "#{ssl_certs_dir}/client-second-level.key"
247
+ end
248
+
249
+ def second_level_cert_bundle_path
250
+ "#{ssl_certs_dir}/client-second-level-bundle.pem"
251
+ end
252
+
253
+ def local_client_encrypted_key_path
254
+ "#{ssl_certs_dir}/client-encrypted.key"
255
+ end
256
+
257
+ def client_encrypted_key_path
258
+ if drivers_tools? && ENV['DRIVER_TOOLS_CLIENT_KEY_ENCRYPTED_PEM']
259
+ ENV['DRIVER_TOOLS_CLIENT_KEY_ENCRYPTED_PEM']
260
+ else
261
+ local_client_encrypted_key_path
262
+ end
263
+ end
264
+
265
+ def client_encrypted_key_passphrase
266
+ 'passphrase'
267
+ end
268
+
269
+ def local_ca_cert_path
270
+ "#{ssl_certs_dir}/ca.crt"
271
+ end
272
+
273
+ def ca_cert_path
274
+ if drivers_tools? && ENV['DRIVER_TOOLS_CA_PEM']
275
+ ENV['DRIVER_TOOLS_CA_PEM']
276
+ else
277
+ local_ca_cert_path
215
278
  end
216
279
  end
217
280
 
281
+ def multi_ca_path
282
+ "#{ssl_certs_dir}/multi-ca.crt"
283
+ end
284
+
218
285
  # The default test database for all specs.
219
286
  def test_db
220
287
  'ruby-driver'.freeze
@@ -234,10 +301,11 @@ EOT
234
301
  if ssl?
235
302
  {
236
303
  ssl: true,
237
- ssl_verify: false,
238
- ssl_cert: client_cert_pem,
239
- ssl_key: client_key_pem,
240
- }
304
+ ssl_verify: true,
305
+ ssl_cert: client_cert_path,
306
+ ssl_key: client_key_path,
307
+ ssl_ca_cert: ca_cert_path,
308
+ }.merge(@uri_tls_options)
241
309
  else
242
310
  {}
243
311
  end