zowe / zlux

The top-level superproject for zLUX. zLUX includes the Zowe Desktop framework in addition to several built-in apps and an example server implementation.
Eclipse Public License 2.0
38 stars 42 forks source link

TN3270 - ZWED0097I Websocket closed #1021

Open Martin-Zeithaml opened 1 week ago

Martin-Zeithaml commented 1 week ago

The terminal is not working after the second usage:

The log shows this suspicious messages.

ZWED0275I - Host=example.com, Port=23, ClientIP=256.257.258.1 Writing to host socket. Length=170
ZWED0136I - Host=example.com, Port=23, ClientIP=256.257.258.1 Content to be sent to host socket=
�
ZWED0097I - Host=example.com, Port=23, ClientIP=256.257.258.1 Websocket closed. Total remaining terminals connected: 0

The buffer length should be 170 bytes, but actually is only \xEF \xBF \xBD.

1000TurquoisePogs commented 1 week ago

Can you reproduce this such that with message logging on you can see what the terminal in the browser sends? https://github.com/zowe/tn3270-ng2/wiki/Loggers#developingdebugging I'm curious to see if the terminal protocol is failing and therefore sending nonsense, or if the network code is failing instead.

1000TurquoisePogs commented 1 week ago

Sadly, the "content to be sent to host socket" is not a hex printout. It's just the raw bytes. So, if you could read that with HEX ON in ISPF, you'd see the actual hex bytes.

1000TurquoisePogs commented 1 week ago

Just a thought... if the message sent resulted in a socket close, it could be a handshake failure. Basically, if the client says it supports X,Y,Z and the server only supports A,B,C, then the server has no choice but to close the socket because they're incompatible. Or worse. the client could be trying to do a TLS handshake while the server is just telnet without TLS. So, I wonder about that... is the config wrong such that there's just a total handshake failure

Martin-Zeithaml commented 1 week ago

The user is able to use terminal once, sometimes twice normally, it means the handshake was successful for these cases.