Skip to content

HTTP/2 connections to Google GFE aren't reused! #750

@bagder

Description

@bagder

I did this

$ curl https://www.google.se/ https://www.google.se/ --trace-ascii dump --trace-time -A "Mozilla/" > /dev/null

I expected the following

... that the single HTTPS connection would be kept alive after the first request and reused for the subsequent one, as it is if you replace www.google.se with daniel.haxx.se.

The interesting snippet of the trace at the end of the first request and the beginning of the second says:

0400: ,"ovr":{},"pq":"","refpd":true,"rfs":[],"scd":10,"sce":5,"stok":
0440: "dZ4Wr9hTodQ_eMzKJ61AiFVM1VE"},"d":{}};google.y.first.push(funct
0480: ion(){if(google.med){google.med('init');google.initHistory();goo
04c0: gle.med('history');}});if(google.j&&google.j.en&&google.j.xi){wi
0500: ndow.setTimeout(google.j.xi,0);}.</script></div></body></html>
20:47:08.886104 == Info: http2_recv returns 0, http2_handle_stream_close
20:47:08.886112 == Info: nread <= 0, server closed connection, bailing
20:47:08.886124 == Info: STATE: PERFORM => DONE handle 0x19982b8; line 1946 (connection #0) 
20:47:08.886131 == Info: multi_done
20:47:08.886137 == Info: free header_recvbuf!!
20:47:08.886269 == Info: Connection #0 to host www.google.se left intact
20:47:08.886287 == Info: Expire cleared
20:47:08.886382 == Info: STATE: INIT => CONNECT handle 0x19982b8; line 1402 (connection #-5000) 
20:47:08.886418 == Info: Found bundle for host www.google.se: 0x19d3748 [can multiplex]
20:47:08.886428 == Info: Connection 0 seems to be dead!
20:47:08.886436 == Info: HTTP/2 DISCONNECT starts now
20:47:08.886448 == Info: HTTP/2 DISCONNECT done
20:47:08.886454 == Info: Closing connection 0
20:47:08.886462 == Info: The cache now contains 0 members
20:47:08.886476 => Send SSL data, 5 bytes (0x5)
0000: .....
20:47:08.886515 == Info: TLSv1.2 (OUT), TLS alert, Client hello (1):
20:47:08.886522 => Send SSL data, 2 bytes (0x2)
0000: ..
20:47:08.887682 == Info: Added connection 1. The cache now contains 1 members
20:47:08.887698 == Info: Hostname www.google.se was found in DNS cache
20:47:08.887719 == Info:   Trying 83.140.66.42...
20:47:08.887751 == Info: STATE: CONNECT => WAITCONNECT handle 0x19982b8; line 1455 (connection #1) 
20:47:08.891580 == Info: Connected to www.google.se (83.140.66.42) port 443 (#1)
20:47:08.891600 == Info: STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x19982b8; line 1554 (connection #1) 
20:47:08.891610 == Info: Marked for [keep alive]: HTTP default
20:47:08.892085 == Info: ALPN, offering h2
20:47:08.892095 == Info: ALPN, offering http/1.1
20:47:08.892172 == Info: Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
20:47:08.904573 == Info: successfully set certificate verify locations:
20:47:08.904590 == Info:   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
20:47:08.904616 == Info: SSL re-using session ID
20:47:08.904650 => Send SSL data, 5 bytes (0x5)
0000: .....

curl/libcurl version

curl 7.49.0-DEV (x86_64-pc-linux-gnu) libcurl/7.49.0-DEV OpenSSL/1.0.2g zlib/1.2.8 c-ares/1.11.0 libidn/1.32 libpsl/0.11.0 (+libicu/55.1) libssh2/1.7.0_DEV nghttp2/1.10.0-DEV librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS Debug TrackMemory IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets Metalink PSL 

operating system

Debian Linux, kernel 4.4.6 but this is most likely an OS independent problem.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions