mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-27 04:09:31 +03:00
tolerate TLS 1.1 / 1.2 disagreement
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user