1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef RTC_BASE_OPENSSL_SESSION_CACHE_H_
- #define RTC_BASE_OPENSSL_SESSION_CACHE_H_
- #include <openssl/ossl_typ.h>
- #include <map>
- #include <string>
- #include "rtc_base/constructor_magic.h"
- #include "rtc_base/ssl_stream_adapter.h"
- #ifndef OPENSSL_IS_BORINGSSL
- typedef struct ssl_session_st SSL_SESSION;
- #endif
- namespace rtc {
- class OpenSSLSessionCache final {
- public:
-
-
-
- OpenSSLSessionCache(SSLMode ssl_mode, SSL_CTX* ssl_ctx);
-
- ~OpenSSLSessionCache();
-
- SSL_SESSION* LookupSession(const std::string& hostname) const;
-
-
- void AddSession(const std::string& hostname, SSL_SESSION* session);
-
- SSL_CTX* GetSSLContext() const;
-
-
- SSLMode GetSSLMode() const;
- private:
-
-
- const SSLMode ssl_mode_;
-
-
-
- SSL_CTX* ssl_ctx_ = nullptr;
-
-
-
- std::map<std::string, SSL_SESSION*> sessions_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLSessionCache);
- };
- }
- #endif
|