Skip to content

Commit

Permalink
add SSL error reporting in sslreadtimeout()
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Mauchle committed Mar 22, 2018
1 parent 2246751 commit 221b0e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ int tlsconnect(struct server *server, struct timeval *when, int timeout, char *t
int sslreadtimeout(SSL *ssl, unsigned char *buf, int num, int timeout, pthread_mutex_t *lock) {
int s, ndesc, cnt, len;
struct pollfd fds[1];
unsigned long error;

if (lock)
pthread_mutex_lock(lock);
Expand Down Expand Up @@ -219,6 +220,9 @@ int sslreadtimeout(SSL *ssl, unsigned char *buf, int num, int timeout, pthread_m
debug(DBG_DBG, "sslreadtimeout: got ssl shutdown");
SSL_shutdown(ssl);
default:
while ((error = ERR_get_error()))
debug(DBG_ERR, "sslreadtimeout: SSL: %s", ERR_error_string(error, NULL));

if (lock)
pthread_mutex_unlock(lock);
return -1;
Expand Down

0 comments on commit 221b0e1

Please sign in to comment.