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

Side by Side Diff: base/nss_init.cc

Issue 4049: Port SSLClientSocket to Linux (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/client_socket.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/nss_init.h" 5 #include "base/nss_init.h"
6 6
7 #include <nss.h> 7 #include <nss.h>
8 8
9 // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424
10 // until NSS 3.12.2 comes out and we update to it.
11 #define Lock FOO_NSS_Lock
12 #include <ssl.h>
13 #undef Lock
14
9 #include "base/logging.h" 15 #include "base/logging.h"
10 #include "base/singleton.h" 16 #include "base/singleton.h"
11 17
12 namespace { 18 namespace {
13 19
14 class NSSInitSingleton { 20 class NSSInitSingleton {
15 public: 21 public:
16 NSSInitSingleton() { 22 NSSInitSingleton() {
17 CHECK(NSS_NoDB_Init(".") == SECSuccess); 23 CHECK(NSS_NoDB_Init(".") == SECSuccess);
24 // Enable ciphers
25 NSS_SetDomesticPolicy();
26 // Enable SSL
27 SSL_OptionSetDefault(SSL_SECURITY, PR_TRUE);
18 } 28 }
19 29
20 ~NSSInitSingleton() { 30 ~NSSInitSingleton() {
31 // Have to clear the cache, or NSS_Shutdown fails with SEC_ERROR_BUSY
32 SSL_ClearSessionCache();
33
21 SECStatus status = NSS_Shutdown(); 34 SECStatus status = NSS_Shutdown();
22 DCHECK(status == SECSuccess); 35 DCHECK(status == SECSuccess);
23 } 36 }
24 }; 37 };
25 38
26 } // namespace 39 } // namespace
27 40
28 namespace base { 41 namespace base {
29 42
30 void EnsureNSSInit() { 43 void EnsureNSSInit() {
31 Singleton<NSSInitSingleton>::get(); 44 Singleton<NSSInitSingleton>::get();
32 } 45 }
33 46
34 } // namespace base 47 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | net/base/client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698