| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // NOTE: This class is provided to support existing Chromium consumers; it is | 5 // NOTE: This class is provided to support existing Chromium consumers; it is |
| 6 // NOT intended for use in NEW code. Configuring a TLS server correctly is a | 6 // NOT intended for use in NEW code. Configuring a TLS server correctly is a |
| 7 // security-sensitive activity with many subtle nuances, and thus care should be | 7 // security-sensitive activity with many subtle nuances, and thus care should be |
| 8 // taken to discuss with //net/OWNERS before any new usages. | 8 // taken to discuss with //net/OWNERS before any new usages. |
| 9 // | 9 // |
| 10 // As such, this header should be treated as an internal implementation detail | 10 // As such, this header should be treated as an internal implementation detail |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Creates an SSL server socket over an already-connected transport socket. | 50 // Creates an SSL server socket over an already-connected transport socket. |
| 51 // The caller must ensure the returned socket does not outlive the server | 51 // The caller must ensure the returned socket does not outlive the server |
| 52 // context. | 52 // context. |
| 53 // | 53 // |
| 54 // The caller starts the SSL server handshake by calling Handshake on the | 54 // The caller starts the SSL server handshake by calling Handshake on the |
| 55 // returned socket. | 55 // returned socket. |
| 56 virtual std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( | 56 virtual std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( |
| 57 std::unique_ptr<StreamSocket> socket) = 0; | 57 std::unique_ptr<StreamSocket> socket) = 0; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // Configures the underlying SSL library for the use of SSL server sockets. | |
| 61 // | |
| 62 // Due to the requirements of the underlying libraries, this should be called | |
| 63 // early in process initialization, before any SSL socket, client or server, | |
| 64 // has been used. | |
| 65 // | |
| 66 // Note: If a process does not use SSL server sockets, this call may be | |
| 67 // omitted. | |
| 68 NET_EXPORT void EnableSSLServerSockets(); | |
| 69 | |
| 70 // Creates an SSL server socket context where all sockets spawned using this | 60 // Creates an SSL server socket context where all sockets spawned using this |
| 71 // context will share the same session cache. | 61 // context will share the same session cache. |
| 72 // | 62 // |
| 73 // The caller must provide the server certificate and private key to use. | 63 // The caller must provide the server certificate and private key to use. |
| 74 // It takes a reference to |certificate|. | 64 // It takes a reference to |certificate|. |
| 75 // The |key| and |ssl_config| parameters are copied. | 65 // The |key| and |ssl_config| parameters are copied. |
| 76 // | 66 // |
| 77 NET_EXPORT std::unique_ptr<SSLServerContext> CreateSSLServerContext( | 67 NET_EXPORT std::unique_ptr<SSLServerContext> CreateSSLServerContext( |
| 78 X509Certificate* certificate, | 68 X509Certificate* certificate, |
| 79 const crypto::RSAPrivateKey& key, | 69 const crypto::RSAPrivateKey& key, |
| 80 const SSLServerConfig& ssl_config); | 70 const SSLServerConfig& ssl_config); |
| 81 | 71 |
| 82 } // namespace net | 72 } // namespace net |
| 83 | 73 |
| 84 #endif // NET_SOCKET_SSL_SERVER_SOCKET_H_ | 74 #endif // NET_SOCKET_SSL_SERVER_SOCKET_H_ |
| OLD | NEW |