Index: webrtc/api/webrtcsession.cc |
diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc |
index 75c69806e94681fa1d880d4a6839c64996bd0573..80352cf83246f3ff5f42a4bfa4be64f496a5e153 100644 |
--- a/webrtc/api/webrtcsession.cc |
+++ b/webrtc/api/webrtcsession.cc |
@@ -512,7 +512,7 @@ |
bool WebRtcSession::Initialize( |
const PeerConnectionFactoryInterface::Options& options, |
- std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator, |
+ std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { |
bundle_policy_ = rtc_configuration.bundle_policy; |
rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; |
@@ -533,7 +533,7 @@ |
dtls_enabled_ = false; |
} else { |
// Enable DTLS by default if we have an identity store or a certificate. |
- dtls_enabled_ = (cert_generator || certificate); |
+ dtls_enabled_ = (dtls_identity_store || certificate); |
// |rtc_configuration| can override the default |dtls_enabled_| value. |
if (rtc_configuration.enable_dtls_srtp) { |
dtls_enabled_ = *(rtc_configuration.enable_dtls_srtp); |
@@ -566,18 +566,19 @@ |
if (!dtls_enabled_) { |
// Construct with DTLS disabled. |
webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
- signaling_thread(), channel_manager_, this, id(), |
- std::unique_ptr<rtc::RTCCertificateGeneratorInterface>())); |
+ signaling_thread(), channel_manager_, this, id())); |
} else { |
// Construct with DTLS enabled. |
if (!certificate) { |
+ // Use the |dtls_identity_store| to generate a certificate. |
+ RTC_DCHECK(dtls_identity_store); |
webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
- signaling_thread(), channel_manager_, this, id(), |
- std::move(cert_generator))); |
+ signaling_thread(), channel_manager_, std::move(dtls_identity_store), |
+ this, id())); |
} else { |
// Use the already generated certificate. |
webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
- signaling_thread(), channel_manager_, this, id(), certificate)); |
+ signaling_thread(), channel_manager_, certificate, this, id())); |
} |
} |