| Index: webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
|
| diff --git a/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm b/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
|
| index b006319cae43ae81e1556cd9035b9051b1a16b62..dbe7b53034fc655c28ef37c0baf7080c79e86789 100644
|
| --- a/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
|
| +++ b/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
|
| @@ -15,6 +15,7 @@
|
| #import "RTCIceServer+Private.h"
|
| #import "WebRTC/RTCLogging.h"
|
|
|
| +#include "webrtc/base/rtccertificategenerator.h"
|
| #include "webrtc/base/sslidentity.h"
|
|
|
| @implementation RTCConfiguration
|
| @@ -86,15 +87,15 @@
|
| _iceConnectionReceivingTimeout;
|
| nativeConfig.ice_backup_candidate_pair_ping_interval =
|
| _iceBackupCandidatePairPingInterval;
|
| - if (_keyType == RTCEncryptionKeyTypeECDSA) {
|
| - std::unique_ptr<rtc::SSLIdentity> identity(
|
| - rtc::SSLIdentity::Generate(webrtc::kIdentityName, rtc::KT_ECDSA));
|
| - if (identity) {
|
| - nativeConfig.certificates.push_back(
|
| - rtc::RTCCertificate::Create(std::move(identity)));
|
| - } else {
|
| - RTCLogWarning(@"Failed to generate ECDSA identity. RSA will be used.");
|
| - }
|
| + rtc::KeyType keyType =
|
| + [[self class] nativeEncryptionKeyTypeForKeyType:_keyType];
|
| + // Generate non-default certificate.
|
| + if (keyType != rtc::KT_DEFAULT) {
|
| + rtc::scoped_refptr<rtc::RTCCertificate> certificate =
|
| + rtc::RTCCertificateGenerator::GenerateCertificate(
|
| + rtc::KeyParams(keyType), rtc::Optional<uint64_t>());
|
| + RTC_CHECK(certificate);
|
| + nativeConfig.certificates.push_back(certificate);
|
| }
|
|
|
| return nativeConfig;
|
| @@ -215,6 +216,16 @@
|
| }
|
| }
|
|
|
| ++ (rtc::KeyType)nativeEncryptionKeyTypeForKeyType:
|
| + (RTCEncryptionKeyType)keyType {
|
| + switch (keyType) {
|
| + case RTCEncryptionKeyTypeRSA:
|
| + return rtc::KT_RSA;
|
| + case RTCEncryptionKeyTypeECDSA:
|
| + return rtc::KT_ECDSA;
|
| + }
|
| +}
|
| +
|
| + (RTCTcpCandidatePolicy)tcpCandidatePolicyForNativePolicy:
|
| (webrtc::PeerConnectionInterface::TcpCandidatePolicy)nativePolicy {
|
| switch (nativePolicy) {
|
|
|