OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/socket/client_socket_factory.h" | 5 #include "net/socket/client_socket_factory.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "net/socket/client_socket_handle.h" | 9 #include "net/socket/client_socket_handle.h" |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 ssl_config, cert_verifier); | 65 ssl_config, cert_verifier); |
66 } | 66 } |
67 return new SSLClientSocketNSS(transport_socket, host_and_port, ssl_config, | 67 return new SSLClientSocketNSS(transport_socket, host_and_port, ssl_config, |
68 shi.release(), cert_verifier, | 68 shi.release(), cert_verifier, |
69 dns_cert_checker); | 69 dns_cert_checker); |
70 #else | 70 #else |
71 NOTIMPLEMENTED(); | 71 NOTIMPLEMENTED(); |
72 return NULL; | 72 return NULL; |
73 #endif | 73 #endif |
74 } | 74 } |
| 75 |
| 76 // TODO(rch): This is only implemented for the NSS SSL library, which is the |
| 77 /// default for Windows, Mac and Linux, but we should implement it everywhere. |
| 78 void ClearSSLSessionCache() { |
| 79 #if defined(OS_WIN) |
| 80 if (!g_use_system_ssl) |
| 81 SSLClientSocketNSS::ClearSessionCache(); |
| 82 #elif defined(USE_OPENSSL) |
| 83 // no-op |
| 84 #elif defined(USE_NSS) |
| 85 SSLClientSocketNSS::ClearSessionCache(); |
| 86 #elif defined(OS_MACOSX) |
| 87 if (!g_use_system_ssl) |
| 88 SSLClientSocketNSS::ClearSessionCache(); |
| 89 #else |
| 90 NOTIMPLEMENTED(); |
| 91 #endif |
| 92 } |
| 93 |
75 }; | 94 }; |
76 | 95 |
77 static base::LazyInstance<DefaultClientSocketFactory> | 96 static base::LazyInstance<DefaultClientSocketFactory> |
78 g_default_client_socket_factory(base::LINKER_INITIALIZED); | 97 g_default_client_socket_factory(base::LINKER_INITIALIZED); |
79 | 98 |
80 } // namespace | 99 } // namespace |
81 | 100 |
82 // Deprecated function (http://crbug.com/37810) that takes a ClientSocket. | 101 // Deprecated function (http://crbug.com/37810) that takes a ClientSocket. |
83 SSLClientSocket* ClientSocketFactory::CreateSSLClientSocket( | 102 SSLClientSocket* ClientSocketFactory::CreateSSLClientSocket( |
84 ClientSocket* transport_socket, | 103 ClientSocket* transport_socket, |
(...skipping 12 matching lines...) Expand all Loading... |
97 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { | 116 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { |
98 return g_default_client_socket_factory.Pointer(); | 117 return g_default_client_socket_factory.Pointer(); |
99 } | 118 } |
100 | 119 |
101 // static | 120 // static |
102 void ClientSocketFactory::UseSystemSSL() { | 121 void ClientSocketFactory::UseSystemSSL() { |
103 g_use_system_ssl = true; | 122 g_use_system_ssl = true; |
104 } | 123 } |
105 | 124 |
106 } // namespace net | 125 } // namespace net |
OLD | NEW |