[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
svaldez | e83af29 | 2016-04-26 14:33:37 | [diff] [blame] | 5 | #ifndef NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |
6 | #define NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ | ||||
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 7 | |
davidben | d80c12c | 2016-10-11 00:13:49 | [diff] [blame^] | 8 | #include <openssl/base.h> |
tbansal | f82cc8e | 2015-10-14 20:05:49 | [diff] [blame] | 9 | #include <stdint.h> |
10 | |||||
danakj | 655b66c | 2016-04-16 00:51:38 | [diff] [blame] | 11 | #include <memory> |
12 | |||||
Avi Drissman | 13fc893 | 2015-12-20 04:40:46 | [diff] [blame] | 13 | #include "base/macros.h" |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 14 | #include "net/base/completion_callback.h" |
15 | #include "net/base/io_buffer.h" | ||||
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 16 | #include "net/socket/ssl_server_socket.h" |
svaldez | 6e7e82a2 | 2015-10-28 19:39:53 | [diff] [blame] | 17 | #include "net/ssl/ssl_server_config.h" |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 18 | |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 19 | namespace net { |
20 | |||||
21 | class SSLInfo; | ||||
22 | |||||
svaldez | e83af29 | 2016-04-26 14:33:37 | [diff] [blame] | 23 | class SSLServerContextImpl : public SSLServerContext { |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 24 | public: |
svaldez | e83af29 | 2016-04-26 14:33:37 | [diff] [blame] | 25 | SSLServerContextImpl(X509Certificate* certificate, |
26 | const crypto::RSAPrivateKey& key, | ||||
27 | const SSLServerConfig& ssl_server_config); | ||||
28 | ~SSLServerContextImpl() override; | ||||
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 29 | |
danakj | 655b66c | 2016-04-16 00:51:38 | [diff] [blame] | 30 | std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( |
31 | std::unique_ptr<StreamSocket> socket) override; | ||||
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 32 | |
33 | private: | ||||
davidben | d80c12c | 2016-10-11 00:13:49 | [diff] [blame^] | 34 | bssl::UniquePtr<SSL_CTX> ssl_ctx_; |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 35 | |
36 | // Options for the SSL socket. | ||||
ryanchung | 987b2ff | 2016-02-19 00:17:12 | [diff] [blame] | 37 | SSLServerConfig ssl_server_config_; |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 38 | |
39 | // Certificate for the server. | ||||
40 | scoped_refptr<X509Certificate> cert_; | ||||
41 | |||||
42 | // Private key used by the server. | ||||
danakj | 655b66c | 2016-04-16 00:51:38 | [diff] [blame] | 43 | std::unique_ptr<crypto::RSAPrivateKey> key_; |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 44 | }; |
45 | |||||
46 | } // namespace net | ||||
47 | |||||
svaldez | e83af29 | 2016-04-26 14:33:37 | [diff] [blame] | 48 | #endif // NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |