blob: 19a47971941f358f58f7a7493133b47857a32828 [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
tbansalf82cc8e2015-10-14 20:05:498#include <stdint.h>
9
danakj655b66c2016-04-16 00:51:3810#include <memory>
11
Avi Drissman13fc8932015-12-20 04:40:4612#include "base/macros.h"
[email protected]c8a80e92014-05-17 16:02:0813#include "net/base/completion_callback.h"
14#include "net/base/io_buffer.h"
eroman87c53d62015-04-02 06:51:0715#include "net/log/net_log.h"
[email protected]c8a80e92014-05-17 16:02:0816#include "net/socket/ssl_server_socket.h"
ryanchungeb9e3bc2016-03-08 05:08:1017#include "net/ssl/scoped_openssl_types.h"
svaldez6e7e82a22015-10-28 19:39:5318#include "net/ssl/ssl_server_config.h"
[email protected]c8a80e92014-05-17 16:02:0819
20// Avoid including misc OpenSSL headers, i.e.:
21// <openssl/bio.h>
22typedef struct bio_st BIO;
23// <openssl/ssl.h>
24typedef struct ssl_st SSL;
ryanchung987b2ff2016-02-19 00:17:1225typedef struct x509_store_ctx_st X509_STORE_CTX;
[email protected]c8a80e92014-05-17 16:02:0826
27namespace net {
28
29class SSLInfo;
30
svaldeze83af292016-04-26 14:33:3731class SSLServerContextImpl : public SSLServerContext {
[email protected]c8a80e92014-05-17 16:02:0832 public:
svaldeze83af292016-04-26 14:33:3733 SSLServerContextImpl(X509Certificate* certificate,
34 const crypto::RSAPrivateKey& key,
35 const SSLServerConfig& ssl_server_config);
36 ~SSLServerContextImpl() override;
[email protected]c8a80e92014-05-17 16:02:0837
danakj655b66c2016-04-16 00:51:3838 std::unique_ptr<SSLServerSocket> CreateSSLServerSocket(
39 std::unique_ptr<StreamSocket> socket) override;
[email protected]c8a80e92014-05-17 16:02:0840
41 private:
ryanchungeb9e3bc2016-03-08 05:08:1042 ScopedSSL_CTX ssl_ctx_;
[email protected]c8a80e92014-05-17 16:02:0843
44 // Options for the SSL socket.
ryanchung987b2ff2016-02-19 00:17:1245 SSLServerConfig ssl_server_config_;
[email protected]c8a80e92014-05-17 16:02:0846
47 // Certificate for the server.
48 scoped_refptr<X509Certificate> cert_;
49
50 // Private key used by the server.
danakj655b66c2016-04-16 00:51:3851 std::unique_ptr<crypto::RSAPrivateKey> key_;
[email protected]c8a80e92014-05-17 16:02:0852};
53
54} // namespace net
55
svaldeze83af292016-04-26 14:33:3756#endif // NET_SOCKET_SSL_SERVER_SOCKET_IMPL_H_