Index: webrtc/base/opensslstreamadapter.cc |
diff --git a/webrtc/base/opensslstreamadapter.cc b/webrtc/base/opensslstreamadapter.cc |
index 51921f143153a171b3573edabd571f265fc9fe22..a134e1449607ad65aa66b6e87c0ea69dca243a18 100644 |
--- a/webrtc/base/opensslstreamadapter.cc |
+++ b/webrtc/base/opensslstreamadapter.cc |
@@ -290,9 +290,10 @@ OpenSSLStreamAdapter::~OpenSSLStreamAdapter() { |
Cleanup(); |
} |
-void OpenSSLStreamAdapter::SetIdentity(SSLIdentity* identity) { |
- ASSERT(!identity_); |
- identity_.reset(static_cast<OpenSSLIdentity*>(identity)); |
+void OpenSSLStreamAdapter::SetCertificate( |
+ scoped_refptr<webrtc::DtlsCertificate> certificate) { |
+ ASSERT(!certificate_.get()); |
+ certificate_ = certificate; |
} |
void OpenSSLStreamAdapter::SetServerRole(SSLRole role) { |
@@ -869,7 +870,7 @@ void OpenSSLStreamAdapter::Cleanup() { |
SSL_CTX_free(ssl_ctx_); |
ssl_ctx_ = NULL; |
} |
- identity_.reset(); |
+ certificate_ = nullptr; |
peer_certificate_.reset(); |
// Clear the DTLS timer |
@@ -977,7 +978,9 @@ SSL_CTX* OpenSSLStreamAdapter::SetupSSLContext() { |
} |
#endif |
- if (identity_ && !identity_->ConfigureIdentity(ctx)) { |
+ if (certificate_.get() && |
+ !static_cast<OpenSSLIdentity*>(certificate_->identity()) |
+ ->ConfigureIdentity(ctx)) { |
SSL_CTX_free(ctx); |
return NULL; |
} |