| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/base/cert_database.h" | 9 #include "net/base/cert_database.h" |
| 10 #include "net/socket/client_socket_handle.h" | 10 #include "net/socket/client_socket_handle.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 ssl_config, context); | 95 ssl_config, context); |
| 96 } | 96 } |
| 97 return new SSLClientSocketNSS(transport_socket, host_and_port, ssl_config, | 97 return new SSLClientSocketNSS(transport_socket, host_and_port, ssl_config, |
| 98 shi.release(), context); | 98 shi.release(), context); |
| 99 #else | 99 #else |
| 100 NOTIMPLEMENTED(); | 100 NOTIMPLEMENTED(); |
| 101 return NULL; | 101 return NULL; |
| 102 #endif | 102 #endif |
| 103 } | 103 } |
| 104 | 104 |
| 105 // TODO(rch): This is only implemented for the NSS SSL library, which is the | |
| 106 /// default for Windows, Mac and Linux, but we should implement it everywhere. | |
| 107 void ClearSSLSessionCache() { | 105 void ClearSSLSessionCache() { |
| 108 #if defined(OS_WIN) | 106 SSLClientSocket::ClearSessionCache(); |
| 109 if (!g_use_system_ssl) | |
| 110 SSLClientSocketNSS::ClearSessionCache(); | |
| 111 #elif defined(USE_OPENSSL) | |
| 112 // no-op | |
| 113 #elif defined(USE_NSS) | |
| 114 SSLClientSocketNSS::ClearSessionCache(); | |
| 115 #elif defined(OS_MACOSX) | |
| 116 if (!g_use_system_ssl) | |
| 117 SSLClientSocketNSS::ClearSessionCache(); | |
| 118 #else | |
| 119 NOTIMPLEMENTED(); | |
| 120 #endif | |
| 121 } | 107 } |
| 122 | 108 |
| 123 }; | 109 }; |
| 124 | 110 |
| 125 static base::LazyInstance<DefaultClientSocketFactory> | 111 static base::LazyInstance<DefaultClientSocketFactory> |
| 126 g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER; | 112 g_default_client_socket_factory = LAZY_INSTANCE_INITIALIZER; |
| 127 | 113 |
| 128 } // namespace | 114 } // namespace |
| 129 | 115 |
| 130 // Deprecated function (http://crbug.com/37810) that takes a StreamSocket. | 116 // Deprecated function (http://crbug.com/37810) that takes a StreamSocket. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 144 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { | 130 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { |
| 145 return g_default_client_socket_factory.Pointer(); | 131 return g_default_client_socket_factory.Pointer(); |
| 146 } | 132 } |
| 147 | 133 |
| 148 // static | 134 // static |
| 149 void ClientSocketFactory::UseSystemSSL() { | 135 void ClientSocketFactory::UseSystemSSL() { |
| 150 g_use_system_ssl = true; | 136 g_use_system_ssl = true; |
| 151 } | 137 } |
| 152 | 138 |
| 153 } // namespace net | 139 } // namespace net |
| OLD | NEW |