| 219 | }; |
| 220 | |
| 221 | class test_tls_default_fail : public test_handler { |
| 222 | static connection_options make_opts() { |
| 223 | ssl_certificate cert("testdata/certs/server-certificate.pem", |
| 224 | "testdata/certs/server-private-key.pem", |
| 225 | "server-password"); |
| 226 | connection_options opts; |
| 227 | opts.ssl_server_options(ssl_server_options(cert)); |
| 228 | return opts; |
| 229 | } |
| 230 | bool failed_; |
| 231 | |
| 232 | public: |
| 233 | |
| 234 | test_tls_default_fail() : test_handler(make_opts()), failed_(false) {} |
| 235 | |
| 236 | void on_listener_start(proton::container& c) override { |
| 237 | connect(c, R"("scheme":"amqps")"); |
| 238 | } |
| 239 | |
| 240 | void on_messaging_error(const proton::error_condition& c) override { |
| 241 | if (failed_) return; |
| 242 | |
| 243 | ASSERT_SUBSTRING("verify failed", c.description()); |
| 244 | failed_ = true; |
| 245 | stop_listener(); |
| 246 | } |
| 247 | |
| 248 | void run() { |
| 249 | container(*this).run(); |
| 250 | ASSERT(failed_); |
| 251 | } |
| 252 | }; |
| 253 | |
| 254 | class test_tls_external : public test_handler { |
| 255 | |