Loading lib/urldata.h +3 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,9 @@ struct ssl_connect_data { current state of the connection. */ bool use; ssl_connection_state state; #ifdef USE_NGHTTP2 bool asked_for_h2; #endif #ifdef USE_SSLEAY /* these ones requires specific SSL-types */ SSL_CTX* ctx; Loading lib/vtls/gtls.c +2 −1 Original line number Diff line number Diff line Loading @@ -618,6 +618,7 @@ gtls_connect_step1(struct connectdata *conn, gnutls_alpn_set_protocols(session, protocols, protocols_size, 0); infof(data, "ALPN, offering %s, %s\n", NGHTTP2_PROTO_VERSION_ID, ALPN_HTTP_1_1); connssl->asked_for_h2 = TRUE; } else { infof(data, "SSL, can't negotiate HTTP/2.0 without ALPN\n"); Loading Loading @@ -1047,7 +1048,7 @@ gtls_connect_step3(struct connectdata *conn, conn->negnpn = NPN_HTTP1_1; } } else { else if(connssl->asked_for_h2) { infof(data, "ALPN, server did not agree to a protocol\n"); } } Loading lib/vtls/nss.c +11 −9 Original line number Diff line number Diff line Loading @@ -667,6 +667,7 @@ static void HandshakeCallback(PRFileDesc *sock, void *arg) switch(state) { case SSL_NEXT_PROTO_NO_SUPPORT: case SSL_NEXT_PROTO_NO_OVERLAP: if(connssl->asked_for_h2) infof(conn->data, "TLS, neither ALPN nor NPN succeeded\n"); return; #ifdef SSL_ENABLE_ALPN Loading Loading @@ -1639,6 +1640,7 @@ static CURLcode nss_setup_connect(struct connectdata *conn, int sockindex) if(SSL_SetNextProtoNego(connssl->handle, alpn_protos, alpn_protos_len) != SECSuccess) goto error; connssl->asked_for_h2 = TRUE; } else { infof(data, "SSL, can't negotiate HTTP/2.0 with neither NPN nor ALPN\n"); Loading lib/vtls/openssl.c +7 −4 Original line number Diff line number Diff line Loading @@ -1742,6 +1742,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) infof(data, "ALPN, offering %s, %s\n", NGHTTP2_PROTO_VERSION_ID, ALPN_HTTP_1_1); connssl->asked_for_h2 = TRUE; } #endif } Loading Loading @@ -2030,12 +2031,14 @@ static CURLcode ossl_connect_step2(struct connectdata *conn, int sockindex) memcmp(NGHTTP2_PROTO_VERSION_ID, neg_protocol, len) == 0) { conn->negnpn = NPN_HTTP2; } else if(len == ALPN_HTTP_1_1_LENGTH && memcmp(ALPN_HTTP_1_1, neg_protocol, ALPN_HTTP_1_1_LENGTH) == 0) { else if(len == ALPN_HTTP_1_1_LENGTH && memcmp(ALPN_HTTP_1_1, neg_protocol, ALPN_HTTP_1_1_LENGTH) == 0) { conn->negnpn = NPN_HTTP1_1; } } else else if(connssl->asked_for_h2) infof(data, "ALPN, server did not agree to a protocol\n"); } #endif Loading lib/vtls/polarssl.c +2 −1 Original line number Diff line number Diff line Loading @@ -358,6 +358,7 @@ polarssl_connect_step1(struct connectdata *conn, ssl_set_alpn_protocols(&connssl->ssl, protocols); infof(data, "ALPN, offering %s, %s\n", protocols[0], protocols[1]); connssl->asked_for_h2 = TRUE; } } #endif Loading Loading @@ -466,7 +467,7 @@ polarssl_connect_step2(struct connectdata *conn, conn->negnpn = NPN_HTTP1_1; } } else { else if(connssl->asked_for_h2) { infof(data, "ALPN, server did not agree to a protocol\n"); } } Loading Loading
lib/urldata.h +3 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,9 @@ struct ssl_connect_data { current state of the connection. */ bool use; ssl_connection_state state; #ifdef USE_NGHTTP2 bool asked_for_h2; #endif #ifdef USE_SSLEAY /* these ones requires specific SSL-types */ SSL_CTX* ctx; Loading
lib/vtls/gtls.c +2 −1 Original line number Diff line number Diff line Loading @@ -618,6 +618,7 @@ gtls_connect_step1(struct connectdata *conn, gnutls_alpn_set_protocols(session, protocols, protocols_size, 0); infof(data, "ALPN, offering %s, %s\n", NGHTTP2_PROTO_VERSION_ID, ALPN_HTTP_1_1); connssl->asked_for_h2 = TRUE; } else { infof(data, "SSL, can't negotiate HTTP/2.0 without ALPN\n"); Loading Loading @@ -1047,7 +1048,7 @@ gtls_connect_step3(struct connectdata *conn, conn->negnpn = NPN_HTTP1_1; } } else { else if(connssl->asked_for_h2) { infof(data, "ALPN, server did not agree to a protocol\n"); } } Loading
lib/vtls/nss.c +11 −9 Original line number Diff line number Diff line Loading @@ -667,6 +667,7 @@ static void HandshakeCallback(PRFileDesc *sock, void *arg) switch(state) { case SSL_NEXT_PROTO_NO_SUPPORT: case SSL_NEXT_PROTO_NO_OVERLAP: if(connssl->asked_for_h2) infof(conn->data, "TLS, neither ALPN nor NPN succeeded\n"); return; #ifdef SSL_ENABLE_ALPN Loading Loading @@ -1639,6 +1640,7 @@ static CURLcode nss_setup_connect(struct connectdata *conn, int sockindex) if(SSL_SetNextProtoNego(connssl->handle, alpn_protos, alpn_protos_len) != SECSuccess) goto error; connssl->asked_for_h2 = TRUE; } else { infof(data, "SSL, can't negotiate HTTP/2.0 with neither NPN nor ALPN\n"); Loading
lib/vtls/openssl.c +7 −4 Original line number Diff line number Diff line Loading @@ -1742,6 +1742,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) infof(data, "ALPN, offering %s, %s\n", NGHTTP2_PROTO_VERSION_ID, ALPN_HTTP_1_1); connssl->asked_for_h2 = TRUE; } #endif } Loading Loading @@ -2030,12 +2031,14 @@ static CURLcode ossl_connect_step2(struct connectdata *conn, int sockindex) memcmp(NGHTTP2_PROTO_VERSION_ID, neg_protocol, len) == 0) { conn->negnpn = NPN_HTTP2; } else if(len == ALPN_HTTP_1_1_LENGTH && memcmp(ALPN_HTTP_1_1, neg_protocol, ALPN_HTTP_1_1_LENGTH) == 0) { else if(len == ALPN_HTTP_1_1_LENGTH && memcmp(ALPN_HTTP_1_1, neg_protocol, ALPN_HTTP_1_1_LENGTH) == 0) { conn->negnpn = NPN_HTTP1_1; } } else else if(connssl->asked_for_h2) infof(data, "ALPN, server did not agree to a protocol\n"); } #endif Loading
lib/vtls/polarssl.c +2 −1 Original line number Diff line number Diff line Loading @@ -358,6 +358,7 @@ polarssl_connect_step1(struct connectdata *conn, ssl_set_alpn_protocols(&connssl->ssl, protocols); infof(data, "ALPN, offering %s, %s\n", protocols[0], protocols[1]); connssl->asked_for_h2 = TRUE; } } #endif Loading Loading @@ -466,7 +467,7 @@ polarssl_connect_step2(struct connectdata *conn, conn->negnpn = NPN_HTTP1_1; } } else { else if(connssl->asked_for_h2) { infof(data, "ALPN, server did not agree to a protocol\n"); } } Loading