Re-land: Add API to get negotiated SSL ciphers
This CL adds an API to the SSL stream adapters and transport channels to get the SSL cipher that was negotiated with the remote peer.
The previously approved CL https://webrtc-codereview.appspot.com/26009004/ was reverted in https://webrtc-codereview.appspot.com/40689004/ due to compilation issues while rolling into Chromium.
As the new method has landed in Chromium in https://crrev.com/bc321c76ace6e1d5a03440e554ccb207159802ec, this should be safe to land here now.
BUG=3976
R=pthatcher@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/37209004
Cr-Commit-Position: refs/heads/master@{#8343}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8343 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/base/sslstreamadapter.h b/webrtc/base/sslstreamadapter.h
index ea966c5..c940ecb 100644
--- a/webrtc/base/sslstreamadapter.h
+++ b/webrtc/base/sslstreamadapter.h
@@ -119,6 +119,12 @@
// chain. The returned certificate is owned by the caller.
virtual bool GetPeerCertificate(SSLCertificate** cert) const = 0;
+ // Retrieves the name of the cipher suite used for the connection
+ // (e.g. "TLS_RSA_WITH_AES_128_CBC_SHA").
+ virtual bool GetSslCipher(std::string* cipher) {
+ return false;
+ }
+
// Key Exporter interface from RFC 5705
// Arguments are:
// label -- the exporter label.
@@ -155,6 +161,10 @@
static bool HaveDtlsSrtp();
static bool HaveExporter();
+ // Returns the default Ssl cipher used between streams of this class.
+ // This is used by the unit tests.
+ static std::string GetDefaultSslCipher();
+
private:
// If true, the server certificate need not match the configured
// server_name, and in fact missing certificate authority and other