unrecoverable SSL failure occured, notify transport and generate error code.
| 424 | |
| 425 | // unrecoverable SSL failure occured, notify transport and generate error code. |
| 426 | static int ssl_failed(pn_transport_t *transport, const char *reason) |
| 427 | { |
| 428 | char buf[512] = "Unknown error."; |
| 429 | if (!reason) { |
| 430 | HRESULT status = GetLastError(); |
| 431 | |
| 432 | FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM, |
| 433 | 0, status, 0, buf, sizeof(buf), 0); |
| 434 | reason = buf; |
| 435 | } |
| 436 | pni_ssl_t *ssl = transport->ssl; |
| 437 | ssl->ssl_closed = true; |
| 438 | ssl->app_input_closed = ssl->app_output_closed = PN_EOS; |
| 439 | ssl->state = SSL_CLOSED; |
| 440 | pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: %s", reason); |
| 441 | return PN_EOS; |
| 442 | } |
| 443 | |
| 444 | static pn_ssl_session_t *ssn_cache_find( pn_ssl_domain_t *domain, const char *id ) |
| 445 | { |
no test coverage detected