proxygen
ServerSSLContext.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <memory>
19 #include <string>
20 
22 
23 namespace folly {
24 
25 class EventBase;
26 class SocketAddress;
27 
28 }
29 
30 namespace wangle {
31 
32 struct SSLCacheOptions;
33 struct SSLContextConfig;
34 class SSLStats;
35 class TLSTicketKeyManager;
36 struct TLSTicketKeySeeds;
37 class SSLSessionCacheManager;
38 class SSLCacheProvider;
39 
40 // A SSL Context that owns a session cache and ticket key manager.
41 // It is used for server side SSL connections.
43  public:
44  explicit ServerSSLContext(SSLVersion version = TLSv1);
45 
46  virtual ~ServerSSLContext() override = default;
47 
48  void setupTicketManager(
49  const TLSTicketKeySeeds* ticketSeeds,
50  const SSLContextConfig& ctxConfig,
51  SSLStats* stats);
52 
53  void setupSessionCache(
54  const SSLContextConfig& ctxConfig,
55  const SSLCacheOptions& cacheOptions,
56  const std::shared_ptr<SSLCacheProvider>& externalCache,
57  const std::string& sessionIdContext,
58  SSLStats* stats);
59 
60  // Get the ticket key manager that this context manages.
62  return ticketManager_.get();
63  }
64 
65  // Get the session cache manager that this context manages.
67  return sessionCacheManager_.get();
68  }
69 
70  private:
71  std::unique_ptr<TLSTicketKeyManager> ticketManager_;
72  std::unique_ptr<SSLSessionCacheManager> sessionCacheManager_;
73 };
74 
75 }
TLSTicketKeyManager * getTicketManager()
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
ProtocolVersion version
const char * string
Definition: Conv.cpp:212
std::unique_ptr< TLSTicketKeyManager > ticketManager_
SSLSessionCacheManager * getSessionCacheManager()
std::unique_ptr< SSLSessionCacheManager > sessionCacheManager_