in netmf/NetMF/TcpTransport.cs [33:96]
public void Connect(Connection connection, Address address, bool noVerification)
{
var ipHostEntry = Dns.GetHostEntry(address.Host);
Exception exception = null;
TcpSocket socket = null;
foreach (var ipAddress in ipHostEntry.AddressList)
{
if (ipAddress == null)
{
continue;
}
try
{
socket = new TcpSocket();
socket.Connect(new IPEndPoint(ipAddress, address.Port));
exception = null;
break;
}
catch (SocketException socketException)
{
if (socket != null)
{
socket.Close();
socket = null;
}
exception = socketException;
}
}
if (exception != null)
{
throw exception;
}
if (address.UseSsl)
{
SslSocket sslSocket = new SslSocket(socket);
#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
sslSocket.AuthenticateAsClient(
address.Host,
null,
noVerification ? SslVerification.NoVerification : SslVerification.VerifyPeer,
SslProtocols.Default);
#elif (NANOFRAMEWORK_1_0)
sslSocket.SslVerification = noVerification ? SslVerification.NoVerification : SslVerification.VerifyPeer;
sslSocket.AuthenticateAsClient(
address.Host,
null,
SslProtocols.Tls11);
#endif
this.socketTransport = sslSocket;
}
else
{
this.socketTransport = socket;
}
}