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

Unified Diff: net/socket/ssl_client_socket_win.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_win.h ('k') | net/socket_stream/socket_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_win.cc
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc
index 38bdfce514ccd0d876417b7620faf37e267d9409..13f3c659d28fcbc3a746bdab8092156f6f20c212 100644
--- a/net/socket/ssl_client_socket_win.cc
+++ b/net/socket/ssl_client_socket_win.cc
@@ -331,7 +331,7 @@ class ClientCertStore {
static const int kRecvBufferSize = (5 + 16*1024 + 64);
SSLClientSocketWin::SSLClientSocketWin(ClientSocketHandle* transport_socket,
- const std::string& hostname,
+ const HostPortPair& host_port_pair,
const SSLConfig& ssl_config)
: ALLOW_THIS_IN_INITIALIZER_LIST(
handshake_io_callback_(this,
@@ -341,7 +341,7 @@ SSLClientSocketWin::SSLClientSocketWin(ClientSocketHandle* transport_socket,
ALLOW_THIS_IN_INITIALIZER_LIST(
write_callback_(this, &SSLClientSocketWin::OnWriteComplete)),
transport_(transport_socket),
- hostname_(hostname),
+ host_port_pair_(host_port_pair),
ssl_config_(ssl_config),
user_connect_callback_(NULL),
user_read_callback_(NULL),
@@ -413,7 +413,7 @@ void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) {
void SSLClientSocketWin::GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) {
- cert_request_info->host_and_port = hostname_; // TODO(wtc): no port!
+ cert_request_info->host_and_port = host_port_pair_.ToString();
cert_request_info->client_certs.clear();
// Get the certificate_authorities field of the CertificateRequest message.
@@ -559,7 +559,9 @@ int SSLClientSocketWin::InitializeSSLContext() {
status = InitializeSecurityContext(
creds_,
NULL, // NULL on the first call
- const_cast<wchar_t*>(ASCIIToWide(hostname_).c_str()),
+ // TODO(davidben): Different ports on the same host to share a cache. It
+ // may be worth keying the port into the CredHandle to separate them.
+ const_cast<wchar_t*>(ASCIIToWide(host_port_pair_.host()).c_str()),
flags,
0, // Reserved
SECURITY_NATIVE_DREP, // TODO(wtc): MSDN says this should be set to 0.
@@ -1026,7 +1028,7 @@ int SSLClientSocketWin::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_win.h ('k') | net/socket_stream/socket_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698