Skip to content

Commit 6f3229e

Browse files
Shigeki Ohtsusxa
authored andcommitted
deps: add -no_rand_screen to openssl s_client
In openssl s_client on Windows, RAND_screen() is invoked to initialize random state but it takes several seconds in each connection. This added -no_rand_screen to openssl s_client on Windows to skip RAND_screen() and gets a better performance in the unit test of test-tls-server-verify. Do not enable this except to use in the unit test. (cherry picked from commit 9f0f7c3) Reviewed-By: James M Snell <[email protected]> PR-URL: nodejs#25368
1 parent 637cd92 commit 6f3229e

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

deps/openssl/openssl/apps/app_rand.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,16 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
124124
char buffer[200];
125125

126126
#ifdef OPENSSL_SYS_WINDOWS
127-
BIO_printf(bio_e, "Loading 'screen' into random state -");
128-
BIO_flush(bio_e);
129-
RAND_screen();
130-
BIO_printf(bio_e, " done\n");
127+
/*
128+
* allocate 2 to dont_warn not to use RAND_screen() via
129+
* -no_rand_screen option in s_client
130+
*/
131+
if (dont_warn != 2) {
132+
BIO_printf(bio_e, "Loading 'screen' into random state -");
133+
BIO_flush(bio_e);
134+
RAND_screen();
135+
BIO_printf(bio_e, " done\n");
136+
}
131137
#endif
132138

133139
if (file == NULL)

0 commit comments

Comments
 (0)