| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <openssl/bio.h> | 10 #include <openssl/bio.h> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 SSLClientSocketOpenSSLClientAuthTest() | 87 SSLClientSocketOpenSSLClientAuthTest() |
| 88 : socket_factory_(ClientSocketFactory::GetDefaultFactory()), | 88 : socket_factory_(ClientSocketFactory::GetDefaultFactory()), |
| 89 cert_verifier_(new MockCertVerifier), | 89 cert_verifier_(new MockCertVerifier), |
| 90 transport_security_state_(new TransportSecurityState) { | 90 transport_security_state_(new TransportSecurityState) { |
| 91 cert_verifier_->set_default_result(OK); | 91 cert_verifier_->set_default_result(OK); |
| 92 context_.cert_verifier = cert_verifier_.get(); | 92 context_.cert_verifier = cert_verifier_.get(); |
| 93 context_.transport_security_state = transport_security_state_.get(); | 93 context_.transport_security_state = transport_security_state_.get(); |
| 94 key_store_ = OpenSSLClientKeyStore::GetInstance(); | 94 key_store_ = OpenSSLClientKeyStore::GetInstance(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual ~SSLClientSocketOpenSSLClientAuthTest() { | 97 ~SSLClientSocketOpenSSLClientAuthTest() override { key_store_->Flush(); } |
| 98 key_store_->Flush(); | |
| 99 } | |
| 100 | 98 |
| 101 protected: | 99 protected: |
| 102 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 100 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
| 103 scoped_ptr<StreamSocket> transport_socket, | 101 scoped_ptr<StreamSocket> transport_socket, |
| 104 const HostPortPair& host_and_port, | 102 const HostPortPair& host_and_port, |
| 105 const SSLConfig& ssl_config) { | 103 const SSLConfig& ssl_config) { |
| 106 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); | 104 scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); |
| 107 connection->SetSocket(transport_socket.Pass()); | 105 connection->SetSocket(transport_socket.Pass()); |
| 108 return socket_factory_->CreateSSLClientSocket(connection.Pass(), | 106 return socket_factory_->CreateSSLClientSocket(connection.Pass(), |
| 109 host_and_port, | 107 host_and_port, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 261 |
| 264 EXPECT_TRUE(CheckSSLClientSocketSentCert()); | 262 EXPECT_TRUE(CheckSSLClientSocketSentCert()); |
| 265 | 263 |
| 266 sock_->Disconnect(); | 264 sock_->Disconnect(); |
| 267 EXPECT_FALSE(sock_->IsConnected()); | 265 EXPECT_FALSE(sock_->IsConnected()); |
| 268 } | 266 } |
| 269 #endif // defined(USE_OPENSSL_CERTS) | 267 #endif // defined(USE_OPENSSL_CERTS) |
| 270 | 268 |
| 271 } // namespace | 269 } // namespace |
| 272 } // namespace net | 270 } // namespace net |
| OLD | NEW |