Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Unified Diff: net/socket/ssl_client_socket_mac.cc

Issue 3174004: Pass both hostname and port into SSLClientSocket (Closed)
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_client_socket_mac.h ('k') | net/socket/ssl_client_socket_mac_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_mac.cc
diff --git a/net/socket/ssl_client_socket_mac.cc b/net/socket/ssl_client_socket_mac.cc
index 4ee9c23920b9d5fdd9fa7fefd3ec5cd729cb6a63..da2c9e2b56fec2729030537d8cf09a2326d3d55c 100644
--- a/net/socket/ssl_client_socket_mac.cc
+++ b/net/socket/ssl_client_socket_mac.cc
@@ -499,7 +499,7 @@ EnabledCipherSuites::EnabledCipherSuites() {
//-----------------------------------------------------------------------------
SSLClientSocketMac::SSLClientSocketMac(ClientSocketHandle* transport_socket,
- const std::string& hostname,
+ const HostPortPair& host_port_pair,
const SSLConfig& ssl_config)
: handshake_io_callback_(this, &SSLClientSocketMac::OnHandshakeIOComplete),
transport_read_callback_(this,
@@ -507,7 +507,7 @@ SSLClientSocketMac::SSLClientSocketMac(ClientSocketHandle* transport_socket,
transport_write_callback_(this,
&SSLClientSocketMac::OnTransportWriteComplete),
transport_(transport_socket),
- hostname_(hostname),
+ host_port_pair_(host_port_pair),
ssl_config_(ssl_config),
user_connect_callback_(NULL),
user_read_callback_(NULL),
@@ -689,9 +689,9 @@ void SSLClientSocketMac::GetSSLCertRequestInfo(
}
// Now get the available client certs whose issuers are allowed by the server.
- cert_request_info->host_and_port = hostname_;
+ cert_request_info->host_and_port = host_port_pair_.ToString();
cert_request_info->client_certs.clear();
- X509Certificate::GetSSLClientCertificates(hostname_,
+ X509Certificate::GetSSLClientCertificates(host_port_pair_.host(),
valid_issuers,
&cert_request_info->client_certs);
SSL_LOG << "Asking user to choose between "
@@ -774,9 +774,10 @@ int SSLClientSocketMac::InitializeSSLContext() {
return NetErrorFromOSStatus(status);
// Passing the domain name enables the server_name TLS extension (SNI).
+ const std::string& hostname = host_port_pair_.host();
status = SSLSetPeerDomainName(ssl_context_,
- hostname_.data(),
- hostname_.length());
+ hostname.data(),
+ hostname.length());
if (status)
return NetErrorFromOSStatus(status);
@@ -819,7 +820,7 @@ int SSLClientSocketMac::InitializeSSLContext() {
if (rv != OK)
return rv;
const struct addrinfo* ai = address.head();
- std::string peer_id(hostname_);
+ std::string peer_id(host_port_pair_.ToString());
peer_id += std::string(reinterpret_cast<char*>(ai->ai_addr),
ai->ai_addrlen);
@@ -1031,7 +1032,7 @@ int SSLClientSocketMac::DoVerifyCert() {
if (ssl_config_.verify_ev_cert)
flags |= X509Certificate::VERIFY_EV_CERT;
verifier_.reset(new CertVerifier);
- return verifier_->Verify(server_cert_, hostname_, flags,
+ return verifier_->Verify(server_cert_, host_port_pair_.host(), flags,
&server_cert_verify_result_,
&handshake_io_callback_);
}
« no previous file with comments | « net/socket/ssl_client_socket_mac.h ('k') | net/socket/ssl_client_socket_mac_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698