Implement certificate chain stats.
There was an implementation, but it relied on SSLCertificate::GetChain,
which was never implemented. Except in the fake certificate classes
used by the stats collector tests, hence the tests were passing.
Instead of implementing GetChain, we decided (in
https://webrtc-review.googlesource.com/c/src/+/6500) to add
methods that return a SSLCertChain directly, since it results in a
somewhat cleaner object model.
So this CL switches everything to use the "chain" methods, and gets
rid of the obsolete methods and member variables.
Bug: webrtc:8920
Change-Id: Ie9d7d53654ba859535462521b54c788adec7badf
Reviewed-on: https://webrtc-review.googlesource.com/56961
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22177}
diff --git a/pc/rtcstatscollector.cc b/pc/rtcstatscollector.cc
index dd8f69e..80e67c5 100644
--- a/pc/rtcstatscollector.cc
+++ b/pc/rtcstatscollector.cc
@@ -1234,13 +1234,13 @@
rtc::scoped_refptr<rtc::RTCCertificate> local_certificate;
if (pc_->GetLocalCertificate(transport_name, &local_certificate)) {
certificate_stats_pair.local =
- local_certificate->ssl_certificate().GetStats();
+ local_certificate->ssl_cert_chain().GetStats();
}
- std::unique_ptr<rtc::SSLCertificate> remote_certificate =
- pc_->GetRemoteSSLCertificate(transport_name);
- if (remote_certificate) {
- certificate_stats_pair.remote = remote_certificate->GetStats();
+ std::unique_ptr<rtc::SSLCertChain> remote_cert_chain =
+ pc_->GetRemoteSSLCertChain(transport_name);
+ if (remote_cert_chain) {
+ certificate_stats_pair.remote = remote_cert_chain->GetStats();
}
transport_cert_stats.insert(