nghttpx: Improve libssl error logging

This commit is contained in:
Tatsuhiro Tsujikawa 2015-10-14 22:32:47 +09:00
parent 1ca64788eb
commit ed1e84fc0a
1 changed files with 17 additions and 0 deletions

View File

@ -349,6 +349,12 @@ int Connection::tls_handshake() {
break; break;
case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_WRITE:
break; break;
case SSL_ERROR_SSL:
if (LOG_ENABLED(INFO)) {
LOG(INFO) << "tls: handshake libssl error: "
<< ERR_error_string(ERR_get_error(), nullptr);
}
return SHRPX_ERR_NETWORK;
default: default:
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
LOG(INFO) << "tls: handshake libssl error " << err; LOG(INFO) << "tls: handshake libssl error " << err;
@ -551,6 +557,12 @@ ssize_t Connection::write_tls(const void *data, size_t len) {
// starting write watcher and timer is done in write_clear via // starting write watcher and timer is done in write_clear via
// bio. // bio.
return 0; return 0;
case SSL_ERROR_SSL:
if (LOG_ENABLED(INFO)) {
LOG(INFO) << "SSL_write: " << ERR_error_string(ERR_get_error(),
nullptr);
}
return SHRPX_ERR_NETWORK;
default: default:
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
LOG(INFO) << "SSL_write: SSL_get_error returned " << err; LOG(INFO) << "SSL_write: SSL_get_error returned " << err;
@ -599,6 +611,11 @@ ssize_t Connection::read_tls(void *data, size_t len) {
return SHRPX_ERR_NETWORK; return SHRPX_ERR_NETWORK;
case SSL_ERROR_ZERO_RETURN: case SSL_ERROR_ZERO_RETURN:
return SHRPX_ERR_EOF; return SHRPX_ERR_EOF;
case SSL_ERROR_SSL:
if (LOG_ENABLED(INFO)) {
LOG(INFO) << "SSL_read: " << ERR_error_string(ERR_get_error(), nullptr);
}
return SHRPX_ERR_NETWORK;
default: default:
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
LOG(INFO) << "SSL_read: SSL_get_error returned " << err; LOG(INFO) << "SSL_read: SSL_get_error returned " << err;