X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=src%2Fconnection.c;h=4538f7532fd5681bf49c775c80ee36dd00f817c5;hb=1af69c9609af41165498e7a1bfda3f32744f12fe;hp=1fbbae57831f1464109380b4e5339df09e72710c;hpb=55ce9f0a9991527dc9a7c09ee03446c3a7c48e93;p=tlsproxy%2Ftlsproxy.git diff --git a/src/connection.c b/src/connection.c index 1fbbae5..4538f75 100644 --- a/src/connection.c +++ b/src/connection.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -788,7 +789,11 @@ static int read_from_write_to_tls(gnutls_session_t from, /* Allow rehandshakes. As handshakes might be insecure make sure that * %SAFE_RENEGOTIATION is used in GnuTLS's priority string. */ if (size_read == GNUTLS_E_REHANDSHAKE) { - int result = gnutls_handshake(from); + int result; + + LOG(DEBUG1, "server requested TLS rehandshake"); + + result = gnutls_handshake(from); if (result != GNUTLS_E_SUCCESS) { LOG(WARNING, "server TLS rehandshake failed: %s", gnutls_strerror(result)); @@ -839,8 +844,10 @@ static int connect_to_host(const char *hostname, const char *port) { gai_hints.ai_socktype = SOCK_STREAM; gai_hints.ai_protocol = 0; gai_hints.ai_flags = AI_NUMERICSERV /* given port is numeric */ +#ifdef AI_ADDRCONFIG | AI_ADDRCONFIG /* supported by this computer */ - | AI_V4MAPPED; /* support IPv4 through IPv6 */ +#endif + ; gai_return = getaddrinfo(hostname, port, &gai_hints, &gai_result); if (gai_return != 0) { if (gai_return == EAI_SYSTEM) {