| 317 | if (config) pn_tls_config_free(config); |
| 318 | } |
| 319 | void init() { |
| 320 | bool dflt = false; |
| 321 | if (!config) { |
| 322 | config = isServer ? default_server_config() : default_client_config(); |
| 323 | dflt = true; |
| 324 | } |
| 325 | REQUIRE(config); |
| 326 | if (!tls) tls = pn_tls(config); |
| 327 | REQUIRE(tls); |
| 328 | if (dflt && !isServer) |
| 329 | pn_tls_set_peer_hostname(tls, "test_server"); |
| 330 | REQUIRE(pn_tls_start(tls) == 0); |
| 331 | } |
| 332 | void cleanup() { |
| 333 | if (tls) { |
| 334 | pn_tls_stop(tls); |
no test coverage detected