Closed temaleva closed 6 months ago
Thanks for the report. I will look into it
@tsegismont Could I help somehow? I was trying to understand how one can synchronize ssl package size with tds package size, but was no able to cope it. I believe, based on the fixes in another projects, this should be the solution. Maybe if you can give me some insides on this, so I can try it once again?
I was able to reproduce with this test in MSSQLEncryptionTest
:
@Test
public void testSmallerPacketSize(TestContext ctx) {
setOptions(rule.options()
.setSsl(true)
.setSslOptions(new ClientSSLOptions().setTrustAll(true))
.setPacketSize(512));
char[] chars = new char[200];
Arrays.fill(chars, 'a');
String str = new String(chars);
connect(ctx.asyncAssertSuccess(conn -> {
conn.query("CREATE TABLE #TestX (text NVARCHAR(MAX))").execute().onComplete(ctx.asyncAssertSuccess(v -> {
conn.preparedQuery("INSERT INTO Test2 (text) VALUES (@p1)").execute(Tuple.of(str)).onComplete(ctx.asyncAssertSuccess());
}));
}));
}
Working on the fix
Fixed by df39408b
Version
At least version 4.x and actual snapshot 5.0.0-SNAPSHOT
Context
By trying to send sql request (especially insert) which exceeds in size current package size
Reproducer
Reproducer quarkus project could be found here https://github.com/eagely/vertx-closed-connection/tree/master
Steps to reproduce
Extra
It looks like the problem is connected with tls package size, which must be synchronized with request package size. The same error was detected (and fixed) in several other mssql clients/libraries, such as .NET and Node.js At least this one looks very similar https://github.com/tediousjs/tedious/issues/923
It could be, that the problem only appeares on linux, but this is also mean in docker env reproducible as well.. Reproducer use sql docker and was started on linux only. (Not know if on windows host the same exception appears).