Using hostname for TLS setup when IP address is not available. This usually

happens when domain name is not resolved through DNS.

BUG=https://code.google.com/p/webrtc/issues/detail?id=3384
R=jiayl@chromium.org
TBR=sergeyu@chromium.org

Review URL: https://codereview.chromium.org/439153004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287553 0039d316-1c4b-4281-b951-d872f2087c98
parent b39a96e4
...@@ -185,10 +185,17 @@ void P2PSocketHostTcpBase::StartTls() { ...@@ -185,10 +185,17 @@ void P2PSocketHostTcpBase::StartTls() {
// Default ssl config. // Default ssl config.
const net::SSLConfig ssl_config; const net::SSLConfig ssl_config;
net::HostPortPair dest_host_port_pair = net::HostPortPair dest_host_port_pair;
net::HostPortPair::FromIPEndPoint(remote_address_.ip_address); if (remote_address_.ip_address.address().empty()) {
DCHECK(!remote_address_.hostname.empty());
dest_host_port_pair = net::HostPortPair::FromString(
remote_address_.hostname);
} else {
dest_host_port_pair = net::HostPortPair::FromIPEndPoint(
remote_address_.ip_address);
if (!remote_address_.hostname.empty()) if (!remote_address_.hostname.empty())
dest_host_port_pair.set_host(remote_address_.hostname); dest_host_port_pair.set_host(remote_address_.hostname);
}
net::ClientSocketFactory* socket_factory = net::ClientSocketFactory* socket_factory =
net::ClientSocketFactory::GetDefaultFactory(); net::ClientSocketFactory::GetDefaultFactory();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment