When running node with NODE_DEBUG="tls,http2", it can be seen that two http2 sessions are created, each with their own TLS handshakes. This is likely due to agent.normalizeOptions return value being different on initial request. Occurrence of each normalizeOptions is logged to illustrate that the value is different on first and second session. (First request belongs to session 1 and requests 2-4 belong to session 2)
After patching the offending option to return an empty string in that function, everything will be performed in one session as one would expect (see below). Unfortunately I'm not too familiar with the internals of this project to really comment on what a proper fix in a case such as this would look like.
Reproduction:
When running
node
withNODE_DEBUG="tls,http2"
, it can be seen that two http2 sessions are created, each with their own TLS handshakes. This is likely due to agent.normalizeOptions return value being different on initial request. Occurrence of each normalizeOptions is logged to illustrate that the value is different on first and second session. (First request belongs to session 1 and requests 2-4 belong to session 2)After patching the offending option to return an empty string in that function, everything will be performed in one session as one would expect (see below). Unfortunately I'm not too familiar with the internals of this project to really comment on what a proper fix in a case such as this would look like.