blob: 5437e4e5a5e5aede4490940954573e58b4cac222 [file] [log] [blame]
[email protected]c8a80e92014-05-17 16:02:081// 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
svaldeze83af292016-04-26 14:33:375#ifndef NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_
6#define NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_
[email protected]c8a80e92014-05-17 16:02:087
davidbend80c12c2016-10-11 00:13:498#include <openssl/base.h>
tbansalf82cc8e2015-10-14 20:05:499#include <stdint.h>
10
danakj655b66c2016-04-16 00:51:3811#include <memory>
12
Avi Drissman13fc8932015-12-20 04:40:4613#include "base/macros.h"
[email protected]c8a80e92014-05-17 16:02:0814#include "net/base/completion_callback.h"
15#include "net/base/io_buffer.h"
[email protected]c8a80e92014-05-17 16:02:0816#include "net/socket/ssl_server_socket.h"
svaldez6e7e82a22015-10-28 19:39:5317#include "net/ssl/ssl_server_config.h"
[email protected]c8a80e92014-05-17 16:02:0818
[email protected]c8a80e92014-05-17 16:02:0819namespace net {
20
21class SSLInfo;
22
svaldeze83af292016-04-26 14:33:3723class SSLServerContextImpl : public SSLServerContext {
[email protected]c8a80e92014-05-17 16:02:0824 public:
svaldeze83af292016-04-26 14:33:3725 SSLServerContextImpl(X509Certificate* certificate,
26 const crypto::RSAPrivateKey& key,
27 const SSLServerConfig& ssl_server_config);
28 ~SSLServerContextImpl() override;
[email protected]c8a80e92014-05-17 16:02:0829
danakj655b66c2016-04-16 00:51:3830 std::unique_ptr<SSLServerSocket> CreateSSLServerSocket(
31 std::unique_ptr<StreamSocket> socket) override;
[email protected]c8a80e92014-05-17 16:02:0832
33 private:
davidbend80c12c2016-10-11 00:13:4934 bssl::UniquePtr<SSL_CTX> ssl_ctx_;
[email protected]c8a80e92014-05-17 16:02:0835
36 // Options for the SSL socket.
ryanchung987b2ff2016-02-19 00:17:1237 SSLServerConfig ssl_server_config_;
[email protected]c8a80e92014-05-17 16:02:0838
39 // Certificate for the server.
40 scoped_refptr<X509Certificate> cert_;
41
42 // Private key used by the server.
danakj655b66c2016-04-16 00:51:3843 std::unique_ptr<crypto::RSAPrivateKey> key_;
[email protected]c8a80e92014-05-17 16:02:0844};
45
46} // namespace net
47
svaldeze83af292016-04-26 14:33:3748#endif // NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_