| 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 "net/base/address_list.h" | 7 #include "net/base/address_list.h" |
| 8 #include "net/base/cert_test_util.h" | 8 #include "net/base/cert_test_util.h" |
| 9 #include "net/base/host_resolver.h" | 9 #include "net/base/host_resolver.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 int rv = transport->Connect(callback.callback()); | 645 int rv = transport->Connect(callback.callback()); |
| 646 if (rv == net::ERR_IO_PENDING) | 646 if (rv == net::ERR_IO_PENDING) |
| 647 rv = callback.WaitForResult(); | 647 rv = callback.WaitForResult(); |
| 648 EXPECT_EQ(net::OK, rv); | 648 EXPECT_EQ(net::OK, rv); |
| 649 | 649 |
| 650 scoped_ptr<net::SSLClientSocket> sock( | 650 scoped_ptr<net::SSLClientSocket> sock( |
| 651 CreateSSLClientSocket(transport, test_server.host_port_pair(), | 651 CreateSSLClientSocket(transport, test_server.host_port_pair(), |
| 652 kDefaultSSLConfig)); | 652 kDefaultSSLConfig)); |
| 653 | 653 |
| 654 rv = sock->Connect(callback.callback()); | 654 rv = sock->Connect(callback.callback()); |
| 655 if (rv == net::ERR_IO_PENDING) |
| 656 rv = callback.WaitForResult(); |
| 655 EXPECT_EQ(net::ERR_SSL_PROTOCOL_ERROR, rv); | 657 EXPECT_EQ(net::ERR_SSL_PROTOCOL_ERROR, rv); |
| 656 } | 658 } |
| 657 | 659 |
| 658 // TODO(rsleevi): Not implemented for Schannel. As Schannel is only used when | 660 // TODO(rsleevi): Not implemented for Schannel. As Schannel is only used when |
| 659 // performing client authentication, it will not be tested here. | 661 // performing client authentication, it will not be tested here. |
| 660 TEST_F(SSLClientSocketTest, CipherSuiteDisables) { | 662 TEST_F(SSLClientSocketTest, CipherSuiteDisables) { |
| 661 // Rather than exhaustively disabling every RC4 ciphersuite defined at | 663 // Rather than exhaustively disabling every RC4 ciphersuite defined at |
| 662 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml, | 664 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml, |
| 663 // only disabling those cipher suites that the test server actually | 665 // only disabling those cipher suites that the test server actually |
| 664 // implements. | 666 // implements. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 ssl_info.cert->os_cert_handle(), certs[0]->os_cert_handle())); | 918 ssl_info.cert->os_cert_handle(), certs[0]->os_cert_handle())); |
| 917 EXPECT_TRUE(net::X509Certificate::IsSameOSCert( | 919 EXPECT_TRUE(net::X509Certificate::IsSameOSCert( |
| 918 intermediates[0], certs[1]->os_cert_handle())); | 920 intermediates[0], certs[1]->os_cert_handle())); |
| 919 EXPECT_TRUE(net::X509Certificate::IsSameOSCert( | 921 EXPECT_TRUE(net::X509Certificate::IsSameOSCert( |
| 920 intermediates[1], certs[2]->os_cert_handle())); | 922 intermediates[1], certs[2]->os_cert_handle())); |
| 921 | 923 |
| 922 sock->Disconnect(); | 924 sock->Disconnect(); |
| 923 EXPECT_FALSE(sock->IsConnected()); | 925 EXPECT_FALSE(sock->IsConnected()); |
| 924 } | 926 } |
| 925 | 927 |
| OLD | NEW |