--- bip-0.8.2/src/connection.c 2009-08-24 19:05:45.000000000 +0200 +++ /home/thijs/bip-0.8.2/src/connection.c 2011-11-07 00:05:50.915514667 +0100 @@ -21,6 +21,7 @@ static int ssl_initialized = 0; static SSL_CTX *sslctx = NULL; static int ssl_cx_idx; +extern FILE *conf_global_log_file; static BIO *errbio = NULL; extern char *conf_ssl_certfile; static int SSLize(connection_t *cn, int *nc); @@ -1202,7 +1203,7 @@ if (!ssl_initialized) { SSL_library_init(); SSL_load_error_strings(); - errbio = BIO_new_fp(stderr,BIO_NOCLOSE); + errbio = BIO_new_fp(conf_global_log_file,BIO_NOCLOSE); ssl_cx_idx = SSL_get_ex_new_index(0, "bip connection_t", NULL, NULL,NULL); @@ -1397,6 +1398,7 @@ /* From now on, we are on error, thus we return 1 to check timeout */ if (err2 == SSL_ERROR_ZERO_RETURN || err2 == SSL_ERROR_SSL) { mylog(LOG_ERROR, "Error in SSL handshake."); + connection_close(cn); cn->connected = CONN_ERROR; return 1; }