Call SSL_shutdown in OpenSSLStreamAdapter::Cleanup.
BUG=crbug/414211 R=juberti@webrtc.org Committed: https://code.google.com/p/webrtc/source/detail?r=7293 Review URL: https://webrtc-codereview.appspot.com/22739004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7301 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -695,6 +695,12 @@ void OpenSSLStreamAdapter::Cleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ssl_) {
|
if (ssl_) {
|
||||||
|
int ret = SSL_shutdown(ssl_);
|
||||||
|
if (ret < 0) {
|
||||||
|
LOG(LS_WARNING) << "SSL_shutdown failed, error = "
|
||||||
|
<< SSL_get_error(ssl_, ret);
|
||||||
|
}
|
||||||
|
|
||||||
SSL_free(ssl_);
|
SSL_free(ssl_);
|
||||||
ssl_ = NULL;
|
ssl_ = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -691,6 +691,13 @@ TEST_F(SSLStreamAdapterTestTLS, TestTLSConnect) {
|
|||||||
TestHandshake();
|
TestHandshake();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Test that closing the connection on one side updates the other side.
|
||||||
|
TEST_F(SSLStreamAdapterTestTLS, TestTLSClose) {
|
||||||
|
TestHandshake();
|
||||||
|
client_ssl_->Close();
|
||||||
|
EXPECT_EQ_WAIT(rtc::SS_CLOSED, server_ssl_->GetState(), handshake_wait_);
|
||||||
|
};
|
||||||
|
|
||||||
// Test transfer -- trivial
|
// Test transfer -- trivial
|
||||||
TEST_F(SSLStreamAdapterTestTLS, TestTLSTransfer) {
|
TEST_F(SSLStreamAdapterTestTLS, TestTLSTransfer) {
|
||||||
TestHandshake();
|
TestHandshake();
|
||||||
|
|||||||
Reference in New Issue
Block a user