Mercurial > hg > monetdb-java
diff tests/TLSTester.java @ 803:1671f2eb130b monetdbs
Send NUL bytes on non-TLS connect
This avoids a hang if we accidentally make a non-TLS connection to a
TLS server.
The hang occurs because in that situation, the MAPI client ends up
waiting for the server to send a MAPI challenge, while the TLS server
ends up waiting for the client to send a TLS Client Hello message.
The NUL bytes are illegal as a Client Hello and a no-op as a MAPI
message.
author | Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com> |
---|---|
date | Mon, 11 Dec 2023 14:47:41 +0100 (16 months ago) |
parents | 5d04490bc58b |
children | 361441253305 |
line wrap: on
line diff
--- a/tests/TLSTester.java +++ b/tests/TLSTester.java @@ -131,7 +131,7 @@ public class TLSTester { // test_connect_client_auth1(); // test_connect_client_auth2(); test_fail_tls_to_plain(); -// test_fail_plain_to_tls(); + test_fail_plain_to_tls(); // test_connect_server_name(); // test_connect_alpn_mapi9(); test_connect_trusted(); @@ -193,7 +193,7 @@ public class TLSTester { } private void test_fail_plain_to_tls() throws IOException, SQLException { - attempt("fail_plain_to_tls", "server1").with(Parameter.TLS, false).expectFailure("asdf"); + attempt("fail_plain_to_tls", "server1").with(Parameter.TLS, false).expectFailure("Cannot connect"); } private void test_connect_server_name() throws IOException, SQLException {