|
78 | 78 | WebMock.enable!
|
79 | 79 | end
|
80 | 80 |
|
81 |
| - it "should provide a useful error message when one is available and certificate validation fails in ruby 2.4 and up" do |
| 81 | + it "should provide a useful error message when one is available and certificate validation fails", :unless => Puppet::Util::Platform.windows? do |
82 | 82 | connection = Puppet::Network::HTTP::Connection.new(
|
83 | 83 | host, port,
|
84 | 84 | :verify => ConstantErrorValidator.new(:fails_with => 'certificate verify failed',
|
|
89 | 89 | end.to raise_error(Puppet::Error, /certificate verify failed: \[shady looking signature\]/)
|
90 | 90 | end
|
91 | 91 |
|
92 |
| - it "should provide a helpful error message when hostname does not match server certificate before ruby 2.4", :unless => RUBY_PLATFORM == 'java' do |
| 92 | + it "should provide a helpful error message when hostname was not match with server certificate", :unless => Puppet::Util::Platform.windows? || RUBY_PLATFORM == 'java' do |
93 | 93 | Puppet[:confdir] = tmpdir('conf')
|
94 | 94 |
|
95 | 95 | connection = Puppet::Network::HTTP::Connection.new(
|
96 | 96 | host, port,
|
97 | 97 | :verify => ConstantErrorValidator.new(
|
98 |
| - :fails_with => "hostname 'myserver' does not match the server certificate", |
| 98 | + :fails_with => 'hostname was not match with server certificate', |
99 | 99 | :peer_certs => [Puppet::TestCa.new.generate('not_my_server',
|
100 | 100 | :subject_alt_names => 'DNS:foo,DNS:bar,DNS:baz,DNS:not_my_server')[:cert]]))
|
101 |
| - expect do |
102 |
| - connection.get('request') |
103 |
| - end.to raise_error(Puppet::Error) do |error| |
104 |
| - error.message =~ /\AServer hostname 'my_server' did not match server certificate; expected one of (.+)/ |
105 |
| - expect($1.split(', ')).to match_array(%w[DNS:foo DNS:bar DNS:baz DNS:not_my_server not_my_server]) |
106 |
| - end |
107 |
| - end |
108 |
| - |
109 |
| - it "should provide a helpful error message when hostname does not match server certificate in ruby 2.4 or greater" do |
110 |
| - Puppet[:confdir] = tmpdir('conf') |
111 | 101 |
|
112 |
| - connection = Puppet::Network::HTTP::Connection.new( |
113 |
| - host, port, |
114 |
| - :verify => ConstantErrorValidator.new( |
115 |
| - :fails_with => "certificate verify failed", |
116 |
| - :peer_certs => [Puppet::TestCa.new.generate('not_my_server', |
117 |
| - :subject_alt_names => 'DNS:foo,DNS:bar,DNS:baz,DNS:not_my_server')[:cert]])) |
118 | 102 | expect do
|
119 | 103 | connection.get('request')
|
120 | 104 | end.to raise_error(Puppet::Error) do |error|
|
|
133 | 117 | end.to raise_error(/some other message/)
|
134 | 118 | end
|
135 | 119 |
|
136 |
| - it "should check all peer certificates for upcoming expiration", :unless => RUBY_PLATFORM == 'java' do |
| 120 | + it "should check all peer certificates for upcoming expiration", :unless => Puppet::Util::Platform.windows? || RUBY_PLATFORM == 'java' do |
137 | 121 | Puppet[:confdir] = tmpdir('conf')
|
138 | 122 | cert = Puppet::TestCa.new.generate('server',
|
139 | 123 | :subject_alt_names => 'DNS:foo,DNS:bar,DNS:baz,DNS:server')[:cert]
|
|
0 commit comments