[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 | |
tbansal | f82cc8e | 2015-10-14 20:05:49 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
danakj | 655b66c | 2016-04-16 00:51:38 | [diff] [blame] | 10 | #include <memory> |
11 | |||||
Avi Drissman | 13fc893 | 2015-12-20 04:40:46 | [diff] [blame] | 12 | #include "base/macros.h" |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 13 | #include "net/base/completion_callback.h" |
14 | #include "net/base/io_buffer.h" | ||||
eroman | 87c53d6 | 2015-04-02 06:51:07 | [diff] [blame] | 15 | #include "net/log/net_log.h" |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 16 | #include "net/socket/ssl_server_socket.h" |
ryanchung | eb9e3bc | 2016-03-08 05:08:10 | [diff] [blame] | 17 | #include "net/ssl/scoped_openssl_types.h" |
svaldez | 6e7e82a2 | 2015-10-28 19:39:53 | [diff] [blame] | 18 | #include "net/ssl/ssl_server_config.h" |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 19 | |
20 | // Avoid including misc OpenSSL headers, i.e.: | ||||
21 | // <openssl/bio.h> | ||||
22 | typedef struct bio_st BIO; | ||||
23 | // <openssl/ssl.h> | ||||
24 | typedef struct ssl_st SSL; | ||||
ryanchung | 987b2ff | 2016-02-19 00:17:12 | [diff] [blame] | 25 | typedef struct x509_store_ctx_st X509_STORE_CTX; |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 26 | |
27 | namespace net { | ||||
28 | |||||
29 | class SSLInfo; | ||||
30 | |||||
svaldez | e83af29 | 2016-04-26 14:33:37 | [diff] [blame^] | 31 | class SSLServerContextImpl : public SSLServerContext { |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 32 | public: |
svaldez | e83af29 | 2016-04-26 14:33:37 | [diff] [blame^] | 33 | SSLServerContextImpl(X509Certificate* certificate, |
34 | const crypto::RSAPrivateKey& key, | ||||
35 | const SSLServerConfig& ssl_server_config); | ||||
36 | ~SSLServerContextImpl() override; | ||||
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 37 | |
danakj | 655b66c | 2016-04-16 00:51:38 | [diff] [blame] | 38 | std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( |
39 | std::unique_ptr<StreamSocket> socket) override; | ||||
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 40 | |
41 | private: | ||||
ryanchung | eb9e3bc | 2016-03-08 05:08:10 | [diff] [blame] | 42 | ScopedSSL_CTX ssl_ctx_; |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 43 | |
44 | // Options for the SSL socket. | ||||
ryanchung | 987b2ff | 2016-02-19 00:17:12 | [diff] [blame] | 45 | SSLServerConfig ssl_server_config_; |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 46 | |
47 | // Certificate for the server. | ||||
48 | scoped_refptr<X509Certificate> cert_; | ||||
49 | |||||
50 | // Private key used by the server. | ||||
danakj | 655b66c | 2016-04-16 00:51:38 | [diff] [blame] | 51 | std::unique_ptr<crypto::RSAPrivateKey> key_; |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 52 | }; |
53 | |||||
54 | } // namespace net | ||||
55 | |||||
svaldez | e83af29 | 2016-04-26 14:33:37 | [diff] [blame^] | 56 | #endif // NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |