News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
SSL/TLS socket errors under 2003 Server  
by Kevin
posted on 2004/03/18

Hi,

I've read through all the messages but haven't seen this error.

Background:

Server using SSLv3/TLS1. Set up as server part of the connection, has a valid certificate.

Client is Windows 2003 server. Can connect and negotiate the certificates. Can receive data from the socket. But, when he tries to send gets the following error:

************** Exception Text **************
Org.Mentalis.Security.SecurityException: An error occurs while communicating with the remote host. ---> Org.Mentalis.Security.Ssl.Shared.SslException: An exception occurred ---> System.ArgumentException: Value was invalid.
at System.Security.Cryptography.RijndaelManagedTransform.TransformBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[] outputBuffer, Int32 outputOffset)
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.InternalEncryptBytes2(Byte[] buffer, Int32 offset, Int32 size, ContentType type)
--- End of inner exception stack trace ---
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.InternalEncryptBytes2(Byte[] buffer, Int32 offset, Int32 size, ContentType type)
at Org.Mentalis.Security.Ssl.Shared.RecordLayer.EncryptBytes(Byte[] buffer, Int32 offset, Int32 size, ContentType type)
at Org.Mentalis.Security.Ssl.Shared.SocketController.ResumeSending()
--- End of inner exception stack trace ---
at Org.Mentalis.Security.Ssl.SecureSocket.EndSend(IAsyncResult asyncResult)
at Org.Mentalis.Security.Ssl.SecureSocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at WSSecureIMLib.ClientChatter.SendMessage(String s) in c:\documents and settings\luxk\my documents\visual studio projects\signedrouter\wsinstantmessagingservercommunicator\clientchatter.cs:line 171

I'm using:

Org.Mentalis.Security
Assembly Version: 1.0.13.700
Win32 Version: 1.0.13.700
CodeBase: file:///C:/BlackwoodKevin/Org.Mentalis.Security.DLL

Any suggestions?

Thanks,
Kevin

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/03/18

I wonder if you could test something for me..? Could you open the file 'RecordLayer.cs' [in the Security\Ssl\Shared directory] and scroll down to lines 327 and 328. Line 327 should be a line calling the method 'InternalEncryptBytes2' and line 328 should be a commented line calling 'InternalEncryptBytes'. Could you comment the first line and uncomment the second line..? After that, recompile the library and see if your client application works now or not.
InternalEncryptBytes2 is a relatively new method that replaced the less performant InternalEncryptBytes method. This new method appeared to be working over here, but perhaps a bug did manage to slip through.

by Kevin
posted on 2004/03/18

With that change the 2003 server wasn't able to negotiate a connection. I don't have time now to get the exact exception thrown, but I'll try to see if I can get it tomorrow.

Thanks,
Kevin

by Kevin
posted on 2004/03/19

I was unable to find any exceptions... the 2003 server box just seems to hang with the change you suggested.

In heavy connection loads, I also found what appears to be a bug in SocketController.cs, line 314 (m_ActiveSend.AsyncResult.Notify(f);)

The exception was:

An unhandled exception of type 'System.NullReferenceException' occurred in org.mentalis.security.dll

Additional information: Object reference not set to an instance of an object.

The debugger claims F is {Cannot access a disposed object named "System.Net.Sockets.Socket". Object name: "System.Net.Sockets.Socket".}

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.