http://bugs.winehq.org/show_bug.cgi?id=19144
--- Comment #4 from Juan Lang juan_lang@yahoo.com 2009-08-05 15:35:36 --- (In reply to comment #0)
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - SSL Provider: ) (Microsoft SQL Server, Error: -2146893048)
Notice that the first error is 0, which is what schannel returns. The second error, the "Microsoft SQL Server" error, is SEC_E_INVALID_TOKEN. I suspect that by changing schannel.c to return 1, you're affecting the first error, but that's not really where the problem is. Googling more leads me to suspect that returning 0 is what's expected, as several snippets of sample code check against SEC_E_OK rather than using FAILED. Here are a few examples:
http://msdn.microsoft.com/en-us/library/aa375205(VS.85).aspx http://exodus.googlecode.com/svn/trunk/exodus/idSSLSchannel.pas http://www.eggheadcafe.com/forumarchives/platformsdksecurity/Jul2005/post233...
Perhaps a +secur32,+relay trace might give us some idea where the SEC_E_INVALID_TOKEN is coming from?