]> granicus.if.org Git - curl/commitdiff
gnutls: disable TLS session tickets
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Sat, 28 Jan 2017 19:06:31 +0000 (20:06 +0100)
committerMichael Kaufmann <mail@michael-kaufmann.ch>
Sat, 28 Jan 2017 19:09:37 +0000 (20:09 +0100)
SSL session reuse with TLS session tickets is not supported yet.
Use SSL session IDs instead.

Fixes https://github.com/curl/curl/issues/1109

lib/vtls/gtls.c

index a992f999477b2f3e9f435a5cabb6e667c0520a63..faa70aca2a7d9398421e1487ca6c7463ea4ddb2d 100644 (file)
@@ -380,6 +380,7 @@ gtls_connect_step1(struct connectdata *conn,
                    int sockindex)
 {
   struct Curl_easy *data = conn->data;
+  unsigned int init_flags;
   gnutls_session_t session;
   int rc;
   bool sni = TRUE; /* default is SNI enabled */
@@ -526,7 +527,14 @@ gtls_connect_step1(struct connectdata *conn,
   }
 
   /* Initialize TLS session as a client */
-  rc = gnutls_init(&conn->ssl[sockindex].session, GNUTLS_CLIENT);
+  init_flags = GNUTLS_CLIENT;
+
+#if defined(GNUTLS_NO_TICKETS)
+  /* Disable TLS session tickets */
+  init_flags |= GNUTLS_NO_TICKETS;
+#endif
+
+  rc = gnutls_init(&conn->ssl[sockindex].session, init_flags);
   if(rc != GNUTLS_E_SUCCESS) {
     failf(data, "gnutls_init() failed: %d", rc);
     return CURLE_SSL_CONNECT_ERROR;