|
77 | 77 | } |
78 | 78 | } |
79 | 79 |
|
80 | | - let(:systemstore) do |
81 | | - res = tmpfile('systemstore') |
| 80 | + let(:cert_file) do |
| 81 | + res = tmpfile('cert_file') |
82 | 82 | File.write(res, https_server.ca_cert) |
83 | 83 | res |
84 | 84 | end |
|
96 | 96 | end |
97 | 97 |
|
98 | 98 | it "connects when the server's CA is in the system store and the connection is mutually authenticated using create_context" do |
99 | | - Puppet::Util.withenv("SSL_CERT_FILE" => systemstore) do |
| 99 | + Puppet::Util.withenv("SSL_CERT_FILE" => cert_file) do |
100 | 100 | client_context = ssl_provider.create_context( |
101 | | - cacerts: [https_server.ca_cert], crls: [https_server.ca_crl], |
| 101 | + cacerts: [], crls: [], |
102 | 102 | client_cert: https_server.server_cert, private_key: https_server.server_key, |
103 | 103 | revocation: false, include_system_store: true |
104 | 104 | ) |
|
109 | 109 | end |
110 | 110 | end |
111 | 111 |
|
112 | | - it "connects when the server's CA is in the system store and the connection is mutually authenticated uning load_context" do |
113 | | - Puppet::Util.withenv("SSL_CERT_FILE" => systemstore) do |
| 112 | + it "connects when the server's CA is in the system store and the connection is mutually authenticated using load_context" do |
| 113 | + Puppet::Util.withenv("SSL_CERT_FILE" => cert_file) do |
114 | 114 | client_context = ssl_provider.load_context(revocation: false, include_system_store: true) |
115 | 115 | https_server.start_server(ctx_proc: ctx_proc) do |port| |
116 | 116 | res = client.get(URI("https://127.0.0.1:#{port}"), options: {ssl_context: client_context}) |
|
132 | 132 |
|
133 | 133 | it "connects when the server's CA is in the system store" do |
134 | 134 | # create a temp cacert bundle |
135 | | - ssl_file = tmpfile('systemstore') |
136 | | - File.write(ssl_file, https_server.ca_cert) |
| 135 | + cert_file = tmpfile('cert_file') |
| 136 | + File.write(cert_file, https_server.ca_cert) |
137 | 137 |
|
138 | 138 | # override path to system cacert bundle, this must be done before |
139 | 139 | # the SSLContext is created and the call to X509::Store.set_default_paths |
140 | | - Puppet::Util.withenv("SSL_CERT_FILE" => ssl_file) do |
| 140 | + Puppet::Util.withenv("SSL_CERT_FILE" => cert_file) do |
141 | 141 | system_context = ssl_provider.create_system_context(cacerts: []) |
142 | 142 | https_server.start_server do |port| |
143 | 143 | res = client.get(URI("https://127.0.0.1:#{port}"), options: {ssl_context: system_context}) |
|
0 commit comments