Skip to content

Commit b187060

Browse files
ofirbarakbengl
authored andcommitted
http2: set origin name correctly when servername is empty
Fixes: #39919 Refs: #39934 PR-URL: #42838 Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 3e1ed1e commit b187060

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎lib/internal/http2/core.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3119,7 +3119,7 @@ function initializeTLSOptions(options, servername){
31193119
options.ALPNProtocols=['h2'];
31203120
if(options.allowHTTP1===true)
31213121
ArrayPrototypePush(options.ALPNProtocols,'http/1.1');
3122-
if(servername!==undefined&&options.servername===undefined)
3122+
if(servername!==undefined&&!options.servername)
31233123
options.servername=servername;
31243124
returnoptions;
31253125
}

‎test/parallel/test-http2-create-client-secure-session.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,9 @@ verifySecureSession(
9191
loadKey('agent1-cert.pem'),
9292
loadKey('ca1-cert.pem'),
9393
{servername: 'agent1'});
94+
95+
verifySecureSession(
96+
loadKey('agent8-key.pem'),
97+
loadKey('agent8-cert.pem'),
98+
loadKey('fake-startcom-root-cert.pem'),
99+
{servername: ''});

0 commit comments

Comments
(0)