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 <paolo@cowtech.it> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
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

+1-1
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
return options;
31253125
}

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

+6
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)