Index: net/socket/ssl_client_socket_openssl.cc |
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc |
index ed4892ceaf646b6458c5b52528ef8bb924d8eae8..d7f65f855113c15caaa5f54bdd0b29f55604f64c 100644 |
--- a/net/socket/ssl_client_socket_openssl.cc |
+++ b/net/socket/ssl_client_socket_openssl.cc |
@@ -667,6 +667,14 @@ int SSLClientSocketOpenSSL::SetSendBufferSize(int32 size) { |
return transport_->socket()->SetSendBufferSize(size); |
} |
+// static |
+void SSLClientSocketOpenSSL::OnSessionFinishedCallback(const SSL* ssl, |
+ int result, |
+ int unused) { |
+ if (result == SSL_CB_HANDSHAKE_DONE) |
+ SSLContext::GetInstance()->session_cache()->CheckIfSessionFinished(ssl); |
+} |
+ |
int SSLClientSocketOpenSSL::Init() { |
DCHECK(!ssl_); |
DCHECK(!transport_bio_); |
@@ -681,6 +689,9 @@ int SSLClientSocketOpenSSL::Init() { |
if (!SSL_set_tlsext_host_name(ssl_, host_and_port_.host().c_str())) |
return ERR_UNEXPECTED; |
+ // Set an OpenSSL callback to monitor this SSL*'s connection. |
+ SSL_set_info_callback(ssl_, &OnSessionFinishedCallback); |
+ |
trying_cached_session_ = context->session_cache()->SetSSLSessionWithKey( |
ssl_, GetSessionCacheKey()); |