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 #ifndef NET_SOCKET_SSL_SERVER_SOCKET_H_ | 5 #ifndef NET_SOCKET_SSL_SERVER_SOCKET_H_ |
6 #define NET_SOCKET_SSL_SERVER_SOCKET_H_ | 6 #define NET_SOCKET_SSL_SERVER_SOCKET_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 public: | 24 public: |
25 ~SSLServerSocket() override {} | 25 ~SSLServerSocket() override {} |
26 | 26 |
27 // Perform the SSL server handshake, and notify the supplied callback | 27 // Perform the SSL server handshake, and notify the supplied callback |
28 // if the process completes asynchronously. If Disconnect is called before | 28 // if the process completes asynchronously. If Disconnect is called before |
29 // completion then the callback will be silently, as for other StreamSocket | 29 // completion then the callback will be silently, as for other StreamSocket |
30 // calls. | 30 // calls. |
31 virtual int Handshake(const CompletionCallback& callback) = 0; | 31 virtual int Handshake(const CompletionCallback& callback) = 0; |
32 }; | 32 }; |
33 | 33 |
34 class SSLServerSocketContext { | |
davidben
2016/01/22 23:57:48
svaldez has been calling the corresponding client
ryanchung
2016/01/29 23:28:15
Done. Will call it SSLServerContext.
| |
35 public: | |
36 // Creates an SSL server socket over an already-connected transport socket. | |
davidben
2016/01/22 23:57:47
Add: The caller must ensure the returned socket do
ryanchung
2016/01/29 23:28:15
Done.
| |
37 // | |
38 // The returned SSLServerSocket takes ownership of |socket|. Stubbed versions | |
39 // of CreateSSLServerSocket will delete |socket| and return NULL. | |
davidben
2016/01/22 23:57:47
What do you mean stubbed versions? Nothing every c
davidben
2016/01/22 23:57:48
This is already expressed in the function signatur
ryanchung
2016/01/29 23:28:15
Whoops, looks like an outdated comment I accidenta
ryanchung
2016/01/29 23:28:15
Done.
| |
40 // | |
41 // The caller starts the SSL server handshake by calling Handshake on the | |
42 // returned socket. | |
43 virtual scoped_ptr<SSLServerSocket> CreateSSLServerSocket( | |
44 scoped_ptr<StreamSocket> socket) = 0; | |
45 }; | |
46 | |
34 // Configures the underlying SSL library for the use of SSL server sockets. | 47 // Configures the underlying SSL library for the use of SSL server sockets. |
35 // | 48 // |
36 // Due to the requirements of the underlying libraries, this should be called | 49 // Due to the requirements of the underlying libraries, this should be called |
37 // early in process initialization, before any SSL socket, client or server, | 50 // early in process initialization, before any SSL socket, client or server, |
38 // has been used. | 51 // has been used. |
39 // | 52 // |
40 // Note: If a process does not use SSL server sockets, this call may be | 53 // Note: If a process does not use SSL server sockets, this call may be |
41 // omitted. | 54 // omitted. |
42 NET_EXPORT void EnableSSLServerSockets(); | 55 NET_EXPORT void EnableSSLServerSockets(); |
43 | 56 |
44 // Creates an SSL server socket over an already-connected transport socket. | 57 // Creates an SSL server socket context where all sockets spawned using this |
58 // context will share the same session cache. | |
59 // | |
45 // The caller must provide the server certificate and private key to use. | 60 // The caller must provide the server certificate and private key to use. |
46 // | |
47 // The returned SSLServerSocket takes ownership of |socket|. Stubbed versions | |
48 // of CreateSSLServerSocket will delete |socket| and return NULL. | |
49 // It takes a reference to |certificate|. | 61 // It takes a reference to |certificate|. |
50 // The |key| and |ssl_config| parameters are copied. | 62 // The |key| and |ssl_config| parameters are copied. |
51 // | 63 // |
52 // The caller starts the SSL server handshake by calling Handshake on the | 64 NET_EXPORT scoped_ptr<SSLServerSocketContext> CreateSSLServerSocketContext( |
davidben
2016/01/22 23:57:48
Ditto re SSLServerSocketContext vs SSLServerContex
ryanchung
2016/01/29 23:28:15
Done.
| |
53 // returned socket. | |
54 NET_EXPORT scoped_ptr<SSLServerSocket> CreateSSLServerSocket( | |
55 scoped_ptr<StreamSocket> socket, | |
56 X509Certificate* certificate, | 65 X509Certificate* certificate, |
57 const crypto::RSAPrivateKey& key, | 66 const crypto::RSAPrivateKey& key, |
58 const SSLServerConfig& ssl_config); | 67 const SSLServerConfig& ssl_config); |
59 | 68 |
60 } // namespace net | 69 } // namespace net |
61 | 70 |
62 #endif // NET_SOCKET_SSL_SERVER_SOCKET_H_ | 71 #endif // NET_SOCKET_SSL_SERVER_SOCKET_H_ |
OLD | NEW |