Skip to content

Commit

Permalink
deps: add -no_rand_screen to openssl s_client
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Shigeki Ohtsu authored and sxa committed Jun 12, 2015
1 parent 637cd92 commit 6f3229e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions deps/openssl/openssl/apps/app_rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,16 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
char buffer[200];

#ifdef OPENSSL_SYS_WINDOWS
BIO_printf(bio_e, "Loading 'screen' into random state -");
BIO_flush(bio_e);
RAND_screen();
BIO_printf(bio_e, " done\n");
/*
* allocate 2 to dont_warn not to use RAND_screen() via
* -no_rand_screen option in s_client
*/
if (dont_warn != 2) {
BIO_printf(bio_e, "Loading 'screen' into random state -");
BIO_flush(bio_e);
RAND_screen();
BIO_printf(bio_e, " done\n");
}
#endif

if (file == NULL)
Expand Down

0 comments on commit 6f3229e

Please sign in to comment.