wolfSSL: Use LIBWOLFSSL_VERSION_HEX to decide whether or not to use WOLFSSL_X509_V_OK
[privoxy.git] / wolfssl.c
index f011491..7f6c964 100644 (file)
--- a/wolfssl.c
+++ b/wolfssl.c
@@ -973,9 +973,9 @@ static void shutdown_connection(WOLFSSL *ssl, const char *type)
          return;
       }
       ret = wolfSSL_shutdown(ssl);
+      shutdown_attempts++;
       if (WOLFSSL_SUCCESS != ret)
       {
-         shutdown_attempts++;
          log_error(LOG_LEVEL_CONNECT, "Failed to shutdown %s connection "
             "on socket %d. Attempts so far: %d, ret: %d", type, fd,
             shutdown_attempts, ret);
@@ -1201,10 +1201,10 @@ extern int create_server_ssl_connection(struct client_state *csp)
    {
       long verify_result = wolfSSL_get_error(ssl, connect_ret);
 
-#ifdef X509_V_OK
-      if (verify_result == X509_V_OK)
-#else
+#if LIBWOLFSSL_VERSION_HEX > 0x05005004
       if (verify_result == WOLFSSL_X509_V_OK)
+#else
+      if (verify_result == X509_V_OK)
 #endif
       {
          ret = 0;