.NET SSL Client creation with Mentalis.org libraries
zachg99_at_gmail.com
Date: 06/22/05
- Next message: Martin.McDonald_at_us.logicalis.com: "IsInRole vs Demand"
- Previous message: Richard Morris: "Graphics.GetHdc causes InvalidOperationException"
- Next in thread: zachg99_at_gmail.com: "Re: .NET SSL Client creation with Mentalis.org libraries"
- Reply: zachg99_at_gmail.com: "Re: .NET SSL Client creation with Mentalis.org libraries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 22 Jun 2005 10:20:16 -0700
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;
}
- Next message: Martin.McDonald_at_us.logicalis.com: "IsInRole vs Demand"
- Previous message: Richard Morris: "Graphics.GetHdc causes InvalidOperationException"
- Next in thread: zachg99_at_gmail.com: "Re: .NET SSL Client creation with Mentalis.org libraries"
- Reply: zachg99_at_gmail.com: "Re: .NET SSL Client creation with Mentalis.org libraries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|