OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_OPENSSL_H_ | 5 #ifndef NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |
6 #define NET_SOCKET_SSL_SERVER_SOCKET_OPENSSL_H_ | 6 #define NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
15 #include "net/log/net_log.h" | 15 #include "net/log/net_log.h" |
16 #include "net/socket/ssl_server_socket.h" | 16 #include "net/socket/ssl_server_socket.h" |
17 #include "net/ssl/scoped_openssl_types.h" | 17 #include "net/ssl/scoped_openssl_types.h" |
18 #include "net/ssl/ssl_server_config.h" | 18 #include "net/ssl/ssl_server_config.h" |
19 | 19 |
20 // Avoid including misc OpenSSL headers, i.e.: | 20 // Avoid including misc OpenSSL headers, i.e.: |
21 // <openssl/bio.h> | 21 // <openssl/bio.h> |
22 typedef struct bio_st BIO; | 22 typedef struct bio_st BIO; |
23 // <openssl/ssl.h> | 23 // <openssl/ssl.h> |
24 typedef struct ssl_st SSL; | 24 typedef struct ssl_st SSL; |
25 typedef struct x509_store_ctx_st X509_STORE_CTX; | 25 typedef struct x509_store_ctx_st X509_STORE_CTX; |
26 | 26 |
27 namespace net { | 27 namespace net { |
28 | 28 |
29 class SSLInfo; | 29 class SSLInfo; |
30 | 30 |
31 class SSLServerContextOpenSSL : public SSLServerContext { | 31 class SSLServerContextImpl : public SSLServerContext { |
32 public: | 32 public: |
33 SSLServerContextOpenSSL(X509Certificate* certificate, | 33 SSLServerContextImpl(X509Certificate* certificate, |
34 const crypto::RSAPrivateKey& key, | 34 const crypto::RSAPrivateKey& key, |
35 const SSLServerConfig& ssl_server_config); | 35 const SSLServerConfig& ssl_server_config); |
36 ~SSLServerContextOpenSSL() override; | 36 ~SSLServerContextImpl() override; |
37 | 37 |
38 std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( | 38 std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( |
39 std::unique_ptr<StreamSocket> socket) override; | 39 std::unique_ptr<StreamSocket> socket) override; |
40 | 40 |
41 private: | 41 private: |
42 ScopedSSL_CTX ssl_ctx_; | 42 ScopedSSL_CTX ssl_ctx_; |
43 | 43 |
44 // Options for the SSL socket. | 44 // Options for the SSL socket. |
45 SSLServerConfig ssl_server_config_; | 45 SSLServerConfig ssl_server_config_; |
46 | 46 |
47 // Certificate for the server. | 47 // Certificate for the server. |
48 scoped_refptr<X509Certificate> cert_; | 48 scoped_refptr<X509Certificate> cert_; |
49 | 49 |
50 // Private key used by the server. | 50 // Private key used by the server. |
51 std::unique_ptr<crypto::RSAPrivateKey> key_; | 51 std::unique_ptr<crypto::RSAPrivateKey> key_; |
52 }; | 52 }; |
53 | 53 |
54 } // namespace net | 54 } // namespace net |
55 | 55 |
56 #endif // NET_SOCKET_SSL_SERVER_SOCKET_OPENSSL_H_ | 56 #endif // NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |
OLD | NEW |