Question

I want to send a message via a java.net.Socket.

The message is: 001C020000C0154C000404850D9583CC00000004560B00E42080004C

For my application I need this message to be sent via one TCP packet.

But checking Wireshark what is happening is, I can see, that it divides the message into two reassembled SSL segments:

  1. 00
  2. 1C020000C0154C000404850D9583CC00000004560B00E42080004C

How can I supress this behavior?

My code is:

OutputStream os = m_sslsocket.getOutputStream();
os.flush();
write(hex2Byte("001C020000C0154C000404850D9583CC00000004560B00E42080004C");
os.flush();

where hex2Byte converts the hexadecimal String to a bytearray.

EDIT: Thank you for your comments.

In any case my protocol stack when observing via WireShark looks as follows: enter image description here

As you can see there are two SSL Segments, where one is with 00 and the other has the rest. How to supress it such, that there is only one segment?

The above is the result of my writing to the outputstream.

(Do not worry about the red. That is just because of IP checksum offload to the network device.)

Was it helpful?

Solution

For my application I need this message to be sent via one TCP packet.

Bad luck, TCP cannot be made to do that reliably, with or without SSL. Adjust your expectations. It's a byte-stream protocol.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top