Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(930)

Unified Diff: net/socket/ssl_server_socket_nss.cc

Issue 679473002: Allow two SSL Server Socket parameters to be tuned by the caller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_server_socket.h ('k') | net/socket/ssl_server_socket_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_server_socket_nss.cc
diff --git a/net/socket/ssl_server_socket_nss.cc b/net/socket/ssl_server_socket_nss.cc
index 879a1fa179266e9c38a806c52fc8b564f1d01fad..7821d5ec763854da0233f9f8abb6fa5a7e23b287 100644
--- a/net/socket/ssl_server_socket_nss.cc
+++ b/net/socket/ssl_server_socket_nss.cc
@@ -53,13 +53,18 @@ namespace net {
namespace {
bool g_nss_server_sockets_init = false;
+int g_max_session_id_cache_entries = 1024;
+int g_ssl_session_id_cache_timeout = 5;
class NSSSSLServerInitSingleton {
public:
NSSSSLServerInitSingleton() {
EnsureNSSSSLInit();
- SSL_ConfigServerSessionIDCache(1024, 5, 5, NULL);
+ SSL_ConfigServerSessionIDCache(g_max_session_id_cache_entries,
+ g_ssl_session_id_cache_timeout,
+ g_ssl_session_id_cache_timeout,
+ NULL);
g_nss_server_sockets_init = true;
}
@@ -74,6 +79,16 @@ static base::LazyInstance<NSSSSLServerInitSingleton>
} // namespace
+void SetSSLServerSessionCacheParameters(
+ int max_session_id_cache_entries,
+ int ssl_session_id_cache_timeout) {
+ DCHECK(!g_nss_server_sockets_init) << "SetSSLServerSessionCacheParameters"
+ << " cannot be called after"
+ << " EnableSSLServerSockets.";
+ g_max_session_id_cache_entries = max_session_id_cache_entries;
+ g_ssl_session_id_cache_timeout = ssl_session_id_cache_timeout;
+}
+
void EnableSSLServerSockets() {
g_nss_ssl_server_init_singleton.Get();
}
@@ -84,7 +99,7 @@ scoped_ptr<SSLServerSocket> CreateSSLServerSocket(
crypto::RSAPrivateKey* key,
const SSLConfig& ssl_config) {
DCHECK(g_nss_server_sockets_init) << "EnableSSLServerSockets() has not been"
- << "called yet!";
+ << " called yet!";
return scoped_ptr<SSLServerSocket>(
new SSLServerSocketNSS(socket.Pass(), cert, key, ssl_config));
« no previous file with comments | « net/socket/ssl_server_socket.h ('k') | net/socket/ssl_server_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698