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