| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 << filepath.value(); | 78 << filepath.value(); |
| 79 return false; | 79 return false; |
| 80 } | 80 } |
| 81 pkey->reset(result); | 81 pkey->reset(result); |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 | 84 |
| 85 class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest { | 85 class SSLClientSocketOpenSSLClientAuthTest : public PlatformTest { |
| 86 public: | 86 public: |
| 87 SSLClientSocketOpenSSLClientAuthTest() | 87 SSLClientSocketOpenSSLClientAuthTest() |
| 88 : socket_factory_(net::ClientSocketFactory::GetDefaultFactory()), | 88 : socket_factory_(ClientSocketFactory::GetDefaultFactory()), |
| 89 cert_verifier_(new net::MockCertVerifier), | 89 cert_verifier_(new MockCertVerifier), |
| 90 transport_security_state_(new net::TransportSecurityState) { | 90 transport_security_state_(new TransportSecurityState) { |
| 91 cert_verifier_->set_default_result(net::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_ = net::OpenSSLClientKeyStore::GetInstance(); | 94 key_store_ = OpenSSLClientKeyStore::GetInstance(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual ~SSLClientSocketOpenSSLClientAuthTest() { | 97 virtual ~SSLClientSocketOpenSSLClientAuthTest() { |
| 98 key_store_->Flush(); | 98 key_store_->Flush(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 protected: | 101 protected: |
| 102 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 102 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
| 103 scoped_ptr<StreamSocket> transport_socket, | 103 scoped_ptr<StreamSocket> transport_socket, |
| 104 const HostPortPair& host_and_port, | 104 const HostPortPair& host_and_port, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 EXPECT_TRUE(CheckSSLClientSocketSentCert()); | 264 EXPECT_TRUE(CheckSSLClientSocketSentCert()); |
| 265 | 265 |
| 266 sock_->Disconnect(); | 266 sock_->Disconnect(); |
| 267 EXPECT_FALSE(sock_->IsConnected()); | 267 EXPECT_FALSE(sock_->IsConnected()); |
| 268 } | 268 } |
| 269 #endif // defined(USE_OPENSSL_CERTS) | 269 #endif // defined(USE_OPENSSL_CERTS) |
| 270 | 270 |
| 271 } // namespace | 271 } // namespace |
| 272 } // namespace net | 272 } // namespace net |
| OLD | NEW |