Ok, I'm sure I'm doing something wrong, i just dont know what. I'm
attemting to create a test client that connects to an existing ssl
server that runs on a socket on an unix server. It uses ssl to encrypt
the connections so I need such functionality in .NET C#.
I'm watching the log file which writes both the connection information
and requests recieved as well as the response data, yet I never see my
request get to the server. I dont see any exceptions either when i run
it. I have the close elsewhere, but when I close the connection still
nothing happens.
url is an instance of the Url class provided in the code examples by
mentalis.org.
Here is my code:
private SecureTcpClient mySecureClient;
private SecureNetworkStream mySecureNetStream;
SecureProtocol sp = SecureProtocol.Tls1 | SecureProtocol.Ssl3;
try
{
SecurityOptions options = new SecurityOptions(sp);
options.Certificate = null;
options.Entity = ConnectionEnd.Client;
options.CommonName = url.Host;
options.VerificationType = CredentialVerification.None;
options.Verifier = null;
options.Flags = SecurityFlags.Default;
options.AllowedAlgorithms = SslAlgorithms.ALL;
mySecureClient = new SecureTcpClient(url.Host, url.Port,options);
}
catch (Exception execpt)
{
MessageBox.Show("Exception occurred while connecting: " +
execpt.ToString());
return;
}
try
{
string request = "Hello";
byte[] reqBytes = Encoding.ASCII.GetBytes(request);
mySecureNetStream = mySecureClient.GetStream();
mySecureNetStream.Write(reqBytes,0,reqBytes.Length);
}
catch (Exception except)
{
MessageBox.Show("Exception occured while sending: " +
except.ToString());
return;
}
zachg99@gmail.com - 22 Jun 2005 20:59 GMT
I found the problem, turns out the server although home built socket
server on unix, expects the HTTP/POST header. All working well now.
William Stacey [MVP] - 22 Jun 2005 23:16 GMT
As an aside, I think fx2.0 also includes ssl socket class(es).

Signature
William Stacey [MVP]
>I found the problem, turns out the server although home built socket
> server on unix, expects the HTTP/POST header. All working well now.