This CL adds the ability for a SSLAdapter to resume a previous session, saving a roundtrip and significantly reducing the # of bytes needed to bring up the new session. To do this, the sessions need to share state. This is addressed by introducing the SSLAdapterFactory object, which can maintain a SSL_CTX and session cache for multiple sessions. This CL does not have unit tests in order to minimize the change size (i.e., to reduce the size of the CP). CL https://chromium-review.googlesource.com/c/558612 builds on this CL and adds tests, but makes some nontrivial changes to SSLStreamAdapter in order to get the test server to share a SSL_CTX across sessions. Bug: 7936 Change-Id: I677b73453d981d5b3a2e66ea9a5be722acd59475 Reviewed-on: https://chromium-review.googlesource.com/575910 Commit-Queue: Justin Uberti <juberti@webrtc.org> Reviewed-by: Emad Omara <emadomara@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org> Cr-Commit-Position: refs/heads/master@{#19342}
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
/*
|
|
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "webrtc/rtc_base/ssladapter.h"
|
|
|
|
#include "webrtc/rtc_base/openssladapter.h"
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
namespace rtc {
|
|
|
|
SSLAdapterFactory* SSLAdapterFactory::Create() {
|
|
return new OpenSSLAdapterFactory();
|
|
}
|
|
|
|
SSLAdapter* SSLAdapter::Create(AsyncSocket* socket) {
|
|
return new OpenSSLAdapter(socket);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
bool InitializeSSL(VerificationCallback callback) {
|
|
return OpenSSLAdapter::InitializeSSL(callback);
|
|
}
|
|
|
|
bool InitializeSSLThread() {
|
|
return OpenSSLAdapter::InitializeSSLThread();
|
|
}
|
|
|
|
bool CleanupSSL() {
|
|
return OpenSSLAdapter::CleanupSSL();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
} // namespace rtc
|