Просмотр исходного кода

tolerate TLS 1.1 / 1.2 disagreement

Christian Grothoff 11 лет назад
Родитель
Сommit
f88e041ca0
3 измененных файлов с 23 добавлено и 8 удалено
  1. 3 0
      ChangeLog
  2. 2 2
      src/include/microhttpd.h
  3. 18 6
      src/testcurl/https/test_https_session_info.c

+ 3 - 0
ChangeLog

@@ -1,3 +1,6 @@
+Tue Apr  7 00:12:36 CEST 2015
+	Releasing libmicrohttpd 0.9.40. -CG
+
 Sat Apr  4 18:28:24 CEST 2015
 	Fix potential deadlock issue in MHD_USE_THREAD_PER_CONNECTION
 	mode if shutdown is initiated while connections are active. -CG

+ 2 - 2
src/include/microhttpd.h

@@ -1,6 +1,6 @@
 /*
      This file is part of libmicrohttpd
-     Copyright (C) 2006-2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2006-2015 Christian Grothoff (and other contributing authors)
 
      This library is free software; you can redistribute it and/or
      modify it under the terms of the GNU Lesser General Public
@@ -130,7 +130,7 @@ typedef intptr_t ssize_t;
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00093907
+#define MHD_VERSION 0x00094000
 
 /**
  * MHD-internal return code for "YES".

+ 18 - 6
src/testcurl/https/test_https_session_info.c

@@ -48,22 +48,34 @@ query_session_ahc (void *cls, struct MHD_Connection *connection,
 {
   struct MHD_Response *response;
   int ret;
-  
+
   if (NULL == *ptr)
     {
       *ptr = &query_session_ahc;
       return MHD_YES;
     }
 
-  if (GNUTLS_TLS1_1 != 
+  if (GNUTLS_TLS1_1 !=
       (ret = MHD_get_connection_info
        (connection,
 	MHD_CONNECTION_INFO_PROTOCOL)->protocol))
     {
-      fprintf (stderr, "Error: requested protocol mismatch (wanted %d, got %d)\n",
-               GNUTLS_SSL3,
-	       ret);
-      return -1;
+      if (GNUTLS_TLS1_2 == ret)
+      {
+        /* as usual, TLS implementations sometimes don't
+           quite do what was asked, just mildly complain... */
+        fprintf (stderr,
+                 "Warning: requested TLS 1.1, got TLS 1.2\n");
+      }
+      else
+      {
+        /* really different version... */
+        fprintf (stderr,
+                 "Error: requested protocol mismatch (wanted %d, got %d)\n",
+                 GNUTLS_TLS1_1,
+                 ret);
+        return -1;
+      }
     }
 
   response = MHD_create_response_from_buffer (strlen (EMPTY_PAGE),