| 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_IMPL_H_ | 5 #ifndef NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |
| 6 #define NET_SOCKET_SSL_SERVER_SOCKET_IMPL_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/socket/ssl_server_socket.h" | 15 #include "net/socket/ssl_server_socket.h" |
| 16 #include "net/ssl/ssl_server_config.h" | 16 #include "net/ssl/ssl_server_config.h" |
| 17 #include "third_party/boringssl/src/include/openssl/base.h" | 17 #include "third_party/boringssl/src/include/openssl/base.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 class SSLInfo; | |
| 22 | |
| 23 class SSLServerContextImpl : public SSLServerContext { | 21 class SSLServerContextImpl : public SSLServerContext { |
| 24 public: | 22 public: |
| 25 SSLServerContextImpl(X509Certificate* certificate, | 23 SSLServerContextImpl(X509Certificate* certificate, |
| 26 const crypto::RSAPrivateKey& key, | 24 const crypto::RSAPrivateKey& key, |
| 27 const SSLServerConfig& ssl_server_config); | 25 const SSLServerConfig& ssl_server_config); |
| 28 ~SSLServerContextImpl() override; | 26 ~SSLServerContextImpl() override; |
| 29 | 27 |
| 30 std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( | 28 std::unique_ptr<SSLServerSocket> CreateSSLServerSocket( |
| 31 std::unique_ptr<StreamSocket> socket) override; | 29 std::unique_ptr<StreamSocket> socket) override; |
| 32 | 30 |
| 33 private: | 31 private: |
| 34 bssl::UniquePtr<SSL_CTX> ssl_ctx_; | 32 bssl::UniquePtr<SSL_CTX> ssl_ctx_; |
| 35 | 33 |
| 36 // Options for the SSL socket. | 34 // Options for the SSL socket. |
| 37 SSLServerConfig ssl_server_config_; | 35 SSLServerConfig ssl_server_config_; |
| 38 | 36 |
| 39 // Certificate for the server. | 37 // Certificate for the server. |
| 40 scoped_refptr<X509Certificate> cert_; | 38 scoped_refptr<X509Certificate> cert_; |
| 41 | 39 |
| 42 // Private key used by the server. | 40 // Private key used by the server. |
| 43 std::unique_ptr<crypto::RSAPrivateKey> key_; | 41 std::unique_ptr<crypto::RSAPrivateKey> key_; |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 } // namespace net | 44 } // namespace net |
| 47 | 45 |
| 48 #endif // NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ | 46 #endif // NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_ |
| OLD | NEW |