[Mono-bugs] [Bug 78597][Nor] Changed - SSL re-negotiation failure with Postgres

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Aug 3 23:37:58 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by fxjrlists at yahoo.com.br.

http://bugzilla.ximian.com/show_bug.cgi?id=78597

--- shadow/78597	2006-08-03 17:41:23.000000000 -0400
+++ shadow/78597.tmp.8923	2006-08-03 23:37:58.000000000 -0400
@@ -332,6 +332,169 @@
 size of transfers to force a renegotiation and I changed it to 2 *
 1024 so I can reach renegotiation time faster :)
 
 I will check what postgresql data this could be.
 
 Again, sorry for taking so long with that. :(
+
+------- Additional Comments From fxjrlists at yahoo.com.br  2006-08-03 23:37 -------
+
+Hi Sebastien!
+
+I tried your patch but I can't get past a renegotiation :(
+
+This is how I applied your patch:
+
+MonoCommit2/mcs/class/Mono.Security $ patch -p0 -i
+~/temp/Mono.Security.InSessionRenegotiation.patch
+patching file Mono.Security.Protocol.Tls/Context.cs
+patching file Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
+patching file Mono.Security.Protocol.Tls/SslStreamBase.cs
+patching file Mono.Security.Protocol.Tls/SslClientStream.cs
+patching file Mono.Security.Protocol.Tls/TlsStream.cs
+patching file Mono.Security.Protocol.Tls/CipherSuite.cs
+patching file Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
+patching file Mono.Security.Protocol.Tls/RecordProtocol.cs
+patching file Mono.Security.Protocol.Tls/SslServerStream.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
+patching file
+Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
+
+
+I set up a test case which loop getting data from server. This data is
+the result of a simple select version();
+
+This is the output I get from server: postgresql 8.1.4
+
+
+LOG:  connection received: host=127.0.0.1 port=41845
+DEBUG:  forked new backend, pid=18647 socket=6
+DEBUG:  SSL connection from "(anonymous)"
+LOG:  connection authorized: user=npgsql_tests database=npgsql_tests
+LOG:  statement: SELECT oid, typname FROM pg_type WHERE typname IN
+('unknown', 'refcursor', 'char', 'bpchar', 'varchar', 'text', 'name',
+'bytea', 'bit', 'bool', 'int2', 'int4', 'int8', 'oid', 'float4',
+'float8', 'numeric', 'inet', 'money', 'date', 'time', 'timetz',
+'timestamp', 'timestamptz', 'point', 'lseg', 'path', 'box', 'circle',
+'polygon')
+LOG:  statement: select version();
+LOG:  statement: select version();
+LOG:  statement: select version();
+LOG:  statement: select version();
+LOG:  statement: select version();
+LOG:  SSL renegotiation failure
+LOG:  SSL error: ssl handshake failure
+LOG:  could not send data to client: Connection reset by peer
+LOG:  SSL error: ssl handshake failure
+LOG:  could not receive data from client: Connection reset by peer
+LOG:  unexpected EOF on client connection
+LOG:  disconnection: session time: 0:00:00.90 user=npgsql_tests
+database=npgsql_tests host=127.0.0.1 port=41845
+DEBUG:  server process (PID 18647) exited with exit code 0
+
+
+And this is what I get from my client:
+
+mono NpgsqlTest.exe
+PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.1
+(Gentoo 4.1.1)
+PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.1
+(Gentoo 4.1.1)
+PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.1
+(Gentoo 4.1.1)
+PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.1
+(Gentoo 4.1.1)
+err
+Backend sent unrecognized response type:
+Successful.
+
+
+This is my test app:
+
+
+using System;
+using System.Data;
+using Npgsql;
+
+namespace npgsqltest
+{
+
+        // npgsql PostgreSQL driver TEST program
+        class NpgsqlTest
+        {
+
+                [STAThread]
+                static void Main(string[] args)
+                {
+                        // test connectivity to the postgresql server
+                        // given a small table output the information
+it contains
+                        NpgsqlEventLog.Level = LogLevel.Debug;
+                NpgsqlEventLog.LogName = "NpgsqlTests.LogFile";
+
+                                String connectionstring =
+"Server=localhost;User
+Id=npgsql_tests;Password=npgsql_tests;Database=npgsql_tests;ssl=yes";
+                                NpgsqlConnection conn = new
+NpgsqlConnection(connectionstring);
+                                conn.Open(); // shouldn't throw exceptions
+
+                        // implement testing here
+                        try
+                        {
+
+                                for(Int32 i = 0; i < 1000; i++)
+                                {
+
+                                        NpgsqlCommand createRow = new
+NpgsqlCommand("select version();", conn);
+                                       
+Console.WriteLine(createRow.ExecuteScalar());
+                                }
+
+                        }
+                        catch (Exception e)
+                        {
+                                Console.WriteLine("err");
+                                Console.WriteLine(e.Message);
+                        }
+                        finally
+                        {
+
+                                conn.Close();
+                                Console.WriteLine("Successful.");
+                        }
+
+
+                }
+        }
+}
+
+
+
+
+Is there any other patch I should apply?
+
+I tried to remove Mono.Security.dll from gac and use a local copy from
+mcs/class/lib/default after applying patch to make sure I wasn't
+getting any older version of it. (I'm saying that because this is the
+same answer I got before applying your patch. :( )
+


More information about the mono-bugs mailing list