diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-12-09 00:09:24 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-12-09 00:09:24 +0100 |
commit | 680d5fd041a64c14b29de2eeb8b14d4cdb199b8b (patch) | |
tree | 1fbc7f24008050ee0937f0610e5e3d9744f82501 /lib/vtls/nss.c | |
parent | 65d141e6da5c6003a1592bbc87ee550b0ad75c2f (diff) |
http2: avoid logging neg "failure" if h2 was not requested
Diffstat (limited to 'lib/vtls/nss.c')
-rw-r--r-- | lib/vtls/nss.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c index 8161b434d..f26cba0d4 100644 --- a/lib/vtls/nss.c +++ b/lib/vtls/nss.c @@ -665,18 +665,19 @@ static void HandshakeCallback(PRFileDesc *sock, void *arg) if(SSL_GetNextProto(sock, &state, buf, &buflen, buflenmax) == SECSuccess) { switch(state) { - case SSL_NEXT_PROTO_NO_SUPPORT: - case SSL_NEXT_PROTO_NO_OVERLAP: + 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; + return; #ifdef SSL_ENABLE_ALPN - case SSL_NEXT_PROTO_SELECTED: - infof(conn->data, "ALPN, server accepted to use %.*s\n", buflen, buf); - break; + case SSL_NEXT_PROTO_SELECTED: + infof(conn->data, "ALPN, server accepted to use %.*s\n", buflen, buf); + break; #endif - case SSL_NEXT_PROTO_NEGOTIATED: - infof(conn->data, "NPN, server accepted to use %.*s\n", buflen, buf); - break; + case SSL_NEXT_PROTO_NEGOTIATED: + infof(conn->data, "NPN, server accepted to use %.*s\n", buflen, buf); + break; } if(buflen == NGHTTP2_PROTO_VERSION_ID_LEN && @@ -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"); |