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 "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "net/socket/ssl_client_socket_nss.h" | 8 #include "net/socket/ssl_client_socket_nss.h" |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include "net/socket/ssl_client_socket_win.h" | 10 #include "net/socket/ssl_client_socket_win.h" |
11 #endif | 11 #endif |
12 | 12 |
13 // This file is only used on platforms where NSS is not the system SSL | 13 // This file is only used on platforms where NSS is not the system SSL |
14 // library. When compiled, this file is the only object module that pulls | 14 // library. When compiled, this file is the only object module that pulls |
15 // in the dependency on NSPR and NSS. This allows us to control which | 15 // in the dependency on NSPR and NSS. This allows us to control which |
16 // projects depend on NSPR and NSS on those platforms. | 16 // projects depend on NSPR and NSS on those platforms. |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 SSLClientSocket* SSLClientSocketNSSFactory( | 20 SSLClientSocket* SSLClientSocketNSSFactory( |
21 ClientSocket* transport_socket, | 21 ClientSocketHandle* transport_socket, |
22 const std::string& hostname, | 22 const std::string& hostname, |
23 const SSLConfig& ssl_config) { | 23 const SSLConfig& ssl_config) { |
24 // TODO(wtc): SSLClientSocketNSS can't do SSL client authentication using | 24 // TODO(wtc): SSLClientSocketNSS can't do SSL client authentication using |
25 // CryptoAPI yet (http://crbug.com/37560), so we fall back on | 25 // CryptoAPI yet (http://crbug.com/37560), so we fall back on |
26 // SSLClientSocketWin. | 26 // SSLClientSocketWin. |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 if (ssl_config.client_cert) | 28 if (ssl_config.client_cert) |
29 return new SSLClientSocketWin(transport_socket, hostname, ssl_config); | 29 return new SSLClientSocketWin(transport_socket, hostname, ssl_config); |
30 #endif | 30 #endif |
31 | 31 |
32 return new SSLClientSocketNSS(transport_socket, hostname, ssl_config); | 32 return new SSLClientSocketNSS(transport_socket, hostname, ssl_config); |
33 } | 33 } |
34 | 34 |
35 } // namespace net | 35 } // namespace net |
OLD | NEW |