@@ -113,7 +113,7 @@ def verify_errors
113
113
WebMock . enable!
114
114
end
115
115
116
- it "should provide a useful error message when one is available and certificate validation fails in ruby 2.4 and up" do
116
+ it "should provide a useful error message when one is available and certificate validation fails" , :unless => Puppet . features . microsoft_windows? do
117
117
connection = Puppet ::Network ::HTTP ::Connection . new (
118
118
host , port ,
119
119
:verify => ConstantErrorValidator . new ( :fails_with => 'certificate verify failed' ,
@@ -124,13 +124,13 @@ def verify_errors
124
124
end . to raise_error ( Puppet ::Error , /certificate verify failed: \[ shady looking signature\] / )
125
125
end
126
126
127
- it "should provide a helpful error message when hostname does not match server certificate before ruby 2.4" do
127
+ it "should provide a helpful error message when hostname was not match with server certificate" , :unless => Puppet . features . microsoft_windows? do
128
128
Puppet [ :confdir ] = tmpdir ( 'conf' )
129
129
130
130
connection = Puppet ::Network ::HTTP ::Connection . new (
131
131
host , port ,
132
132
:verify => ConstantErrorValidator . new (
133
- :fails_with => " hostname 'myserver' does not match the server certificate" ,
133
+ :fails_with => ' hostname was not match with server certificate' ,
134
134
:peer_certs => [ Puppet ::SSL ::CertificateAuthority . new . generate (
135
135
'not_my_server' , :dns_alt_names => 'foo,bar,baz' ) ] ) )
136
136
@@ -142,24 +142,6 @@ def verify_errors
142
142
end
143
143
end
144
144
145
- it "should provide a helpful error message when hostname does not match server certificate in ruby 2.4 or greater" do
146
- Puppet [ :confdir ] = tmpdir ( 'conf' )
147
-
148
- connection = Puppet ::Network ::HTTP ::Connection . new (
149
- host , port ,
150
- :verify => ConstantErrorValidator . new (
151
- :fails_with => "certificate verify failed" ,
152
- :peer_certs => [ Puppet ::SSL ::CertificateAuthority . new . generate (
153
- 'not_my_server' , :dns_alt_names => 'foo,bar,baz' ) ] ) )
154
-
155
- expect do
156
- connection . get ( 'request' )
157
- end . to raise_error ( Puppet ::Error ) do |error |
158
- error . message =~ /\A Server hostname 'my_server' did not match server certificate; expected one of (.+)/
159
- expect ( $1. split ( ', ' ) ) . to match_array ( %w[ DNS:foo DNS:bar DNS:baz DNS:not_my_server not_my_server ] )
160
- end
161
- end
162
-
163
145
it "should pass along the error message otherwise" do
164
146
connection = Puppet ::Network ::HTTP ::Connection . new (
165
147
host , port ,
@@ -170,7 +152,7 @@ def verify_errors
170
152
end . to raise_error ( /some other message/ )
171
153
end
172
154
173
- it "should check all peer certificates for upcoming expiration" do
155
+ it "should check all peer certificates for upcoming expiration" , :unless => Puppet . features . microsoft_windows? do
174
156
Puppet [ :confdir ] = tmpdir ( 'conf' )
175
157
cert = Puppet ::SSL ::CertificateAuthority . new . generate (
176
158
'server' , :dns_alt_names => 'foo,bar,baz' )
0 commit comments