summaryrefslogtreecommitdiffstats
path: root/jingle/notifier
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 17:55:17 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-19 17:55:17 +0000
commit2d88e7d8b4c382e0ef178c52a87450c226150ef2 (patch)
treeb76d5921ed1ed5c2321570306779aab993f74568 /jingle/notifier
parentf7b2b6a665c130d4ca6b08fdec87b2fad3198f3d (diff)
downloadchromium_src-2d88e7d8b4c382e0ef178c52a87450c226150ef2.zip
chromium_src-2d88e7d8b4c382e0ef178c52a87450c226150ef2.tar.gz
chromium_src-2d88e7d8b4c382e0ef178c52a87450c226150ef2.tar.bz2
Change SpdySession::GetSSLInfo to get the SSLInfo from the underlying socket
even if the session is not "secure". This required refactoring StreamSocket to add WasNpnNegotiated() and GetSSLInfo() methods. This allows for a change to SpdySession::GetSSLInfo to accurately return the correct SSLInfo in the case of SPDY Proxy sessions. BUG=134690 TEST=\*DoNotUseSpdySessionIfCertDoesNotMatch\* Review URL: https://chromiumcodereview.appspot.com/10690122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/notifier')
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket.cc8
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket.h3
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket_unittest.cc2
-rw-r--r--jingle/notifier/base/proxy_resolving_client_socket.cc8
-rw-r--r--jingle/notifier/base/proxy_resolving_client_socket.h2
5 files changed, 23 insertions, 0 deletions
diff --git a/jingle/notifier/base/fake_ssl_client_socket.cc b/jingle/notifier/base/fake_ssl_client_socket.cc
index ec8fd26..3329e31 100644
--- a/jingle/notifier/base/fake_ssl_client_socket.cc
+++ b/jingle/notifier/base/fake_ssl_client_socket.cc
@@ -338,8 +338,16 @@ base::TimeDelta FakeSSLClientSocket::GetConnectTimeMicros() const {
return transport_socket_->GetConnectTimeMicros();
}
+bool FakeSSLClientSocket::WasNpnNegotiated() const {
+ return transport_socket_->WasNpnNegotiated();
+}
+
net::NextProto FakeSSLClientSocket::GetNegotiatedProtocol() const {
return transport_socket_->GetNegotiatedProtocol();
}
+bool FakeSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) {
+ return transport_socket_->GetSSLInfo(ssl_info);
+}
+
} // namespace notifier
diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h
index f7dc215..b9df8a6 100644
--- a/jingle/notifier/base/fake_ssl_client_socket.h
+++ b/jingle/notifier/base/fake_ssl_client_socket.h
@@ -29,6 +29,7 @@
namespace net {
class DrainableIOBuffer;
+class SSLInfo;
} // namespace net
namespace notifier {
@@ -64,7 +65,9 @@ class FakeSSLClientSocket : public net::StreamSocket {
virtual bool UsingTCPFastOpen() const OVERRIDE;
virtual int64 NumBytesRead() const OVERRIDE;
virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
+ virtual bool WasNpnNegotiated() const OVERRIDE;
virtual net::NextProto GetNegotiatedProtocol() const OVERRIDE;
+ virtual bool GetSSLInfo(net::SSLInfo* ssl_info) OVERRIDE;
private:
enum HandshakeState {
diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
index fddb693..617e4d1 100644
--- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
+++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
@@ -65,7 +65,9 @@ class MockClientSocket : public net::StreamSocket {
MOCK_CONST_METHOD0(UsingTCPFastOpen, bool());
MOCK_CONST_METHOD0(NumBytesRead, int64());
MOCK_CONST_METHOD0(GetConnectTimeMicros, base::TimeDelta());
+ MOCK_CONST_METHOD0(WasNpnNegotiated, bool());
MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto());
+ MOCK_METHOD1(GetSSLInfo, bool(net::SSLInfo*));
};
// Break up |data| into a bunch of chunked MockReads/Writes and push
diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc
index 9abe6e3..eb14d56 100644
--- a/jingle/notifier/base/proxy_resolving_client_socket.cc
+++ b/jingle/notifier/base/proxy_resolving_client_socket.cc
@@ -368,6 +368,10 @@ base::TimeDelta ProxyResolvingClientSocket::GetConnectTimeMicros() const {
return base::TimeDelta::FromMicroseconds(-1);
}
+bool ProxyResolvingClientSocket::WasNpnNegotiated() const {
+ return false;
+}
+
net::NextProto ProxyResolvingClientSocket::GetNegotiatedProtocol() const {
if (transport_.get() && transport_->socket())
return transport_->socket()->GetNegotiatedProtocol();
@@ -375,6 +379,10 @@ net::NextProto ProxyResolvingClientSocket::GetNegotiatedProtocol() const {
return net::kProtoUnknown;
}
+bool ProxyResolvingClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) {
+ return false;
+}
+
void ProxyResolvingClientSocket::CloseTransportSocket() {
if (transport_.get() && transport_->socket())
transport_->socket()->Disconnect();
diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h
index 0944a0b..e2426ec 100644
--- a/jingle/notifier/base/proxy_resolving_client_socket.h
+++ b/jingle/notifier/base/proxy_resolving_client_socket.h
@@ -66,7 +66,9 @@ class ProxyResolvingClientSocket : public net::StreamSocket {
virtual bool UsingTCPFastOpen() const OVERRIDE;
virtual int64 NumBytesRead() const OVERRIDE;
virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE;
+ virtual bool WasNpnNegotiated() const OVERRIDE;
virtual net::NextProto GetNegotiatedProtocol() const OVERRIDE;
+ virtual bool GetSSLInfo(net::SSLInfo* ssl_info) OVERRIDE;
private:
// Proxy resolution and connection functions.