Skip to content

Commit 958d2ff

Browse files
committed
nss: prevent NSS from incorrectly re-using a session
Without this workaround, NSS re-uses a session cache entry despite the server name does not match. This causes SNI host name to differ from the actual host name. Consequently, certain servers (e.g. github.com) respond by 400 to such requests. Bug: https://bugzilla.mozilla.org/1202264
1 parent a9fd538 commit 958d2ff

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

RELEASE-NOTES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ This release includes the following bugfixes:
5858
o winbuild: run buildconf.bat if necessary
5959
o buildconf.bat: fix syntax error
6060
o curl_sspi: fix possibly undefined CRYPT_E_REVOKED [16]
61+
o nss: prevent NSS from incorrectly re-using a session [18]
6162

6263
This release includes the following known bugs:
6364

@@ -96,3 +97,4 @@ References to bug reports and discussions on issues:
9697
[15] = http://curl.haxx.se/bug/?i=409
9798
[16] = http://curl.haxx.se/bug/?i=411
9899
[17] = http://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/
100+
[18] = https://bugzilla.mozilla.org/1202264

lib/vtls/nss.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,10 @@ static CURLcode nss_setup_connect(struct connectdata *conn, int sockindex)
18061806
if(SSL_SetURL(connssl->handle, conn->host.name) != SECSuccess)
18071807
goto error;
18081808

1809+
/* prevent NSS from re-using the session for a different hostname */
1810+
if(SSL_SetSockPeerID(connssl->handle, conn->host.name) != SECSuccess)
1811+
goto error;
1812+
18091813
return CURLE_OK;
18101814

18111815
error:

0 commit comments

Comments
 (0)