| Index: net/socket/nss_ssl_util.cc
|
| diff --git a/net/socket/nss_ssl_util.cc b/net/socket/nss_ssl_util.cc
|
| index b92600aad6e4c0bb6fac6c3e73225c9b43f43800..7ea3baf2488943d866069168868a8cfbcbdb6afd 100644
|
| --- a/net/socket/nss_ssl_util.cc
|
| +++ b/net/socket/nss_ssl_util.cc
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "net/socket/nss_ssl_util.h"
|
| +#include "net/socket/nss_ssl_util_internal.h"
|
|
|
| #include <nss.h>
|
| #include <secerr.h>
|
| @@ -22,6 +23,8 @@
|
|
|
| namespace net {
|
|
|
| +namespace {
|
| +
|
| class NSSSSLInitSingleton {
|
| public:
|
| NSSSSLInitSingleton() {
|
| @@ -69,9 +72,27 @@ class NSSSSLInitSingleton {
|
| }
|
| };
|
|
|
| +class NSSSSLServerInitSingleton {
|
| + public:
|
| + NSSSSLServerInitSingleton() {
|
| + EnsureNSSSSLInit();
|
| +
|
| + SSL_ConfigServerSessionIDCache(1024, 5, 5, NULL);
|
| + }
|
| +
|
| + ~NSSSSLServerInitSingleton() {
|
| + SSL_ShutdownServerSessionIDCache();
|
| + }
|
| +};
|
| +
|
| static base::LazyInstance<NSSSSLInitSingleton> g_nss_ssl_init_singleton =
|
| LAZY_INSTANCE_INITIALIZER;
|
|
|
| +static base::LazyInstance<NSSSSLServerInitSingleton>
|
| + g_nss_ssl_server_init_singleton = LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +} // namespace
|
| +
|
| // Initialize the NSS SSL library if it isn't already initialized. This must
|
| // be called before any other NSS SSL functions. This function is
|
| // thread-safe, and the NSS SSL library will only ever be initialized once.
|
| @@ -85,6 +106,10 @@ void EnsureNSSSSLInit() {
|
| g_nss_ssl_init_singleton.Get();
|
| }
|
|
|
| +void EnsureNSSSSLServerInit() {
|
| + g_nss_ssl_server_init_singleton.Get();
|
| +}
|
| +
|
| // Map a Chromium net error code to an NSS error code.
|
| // See _MD_unix_map_default_error in the NSS source
|
| // tree for inspiration.
|
|
|