Skip to content

Commit 8cf50f0

Browse files
committed
SESSION_SSL=NEVER
Signed-off-by: Neil Johnson <[email protected]>
1 parent a934485 commit 8cf50f0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tnz/tnz.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -2118,33 +2118,40 @@ def _proc3270ds(self, b_str, zti=None):
21182118
def _process(self, data):
21192119
"""Process host data.
21202120
"""
2121+
self.__log_info("i<< data: %r...", data[:5])
21212122
if data[:2] == b"\xff\xfd": # IAC DO
21222123
self.__log_info("i<< IAC DO %s", self.__tnon(data[2]))
21232124
opt = data[2]
21242125

21252126
if data[2] == 40: # TN3270E
2127+
self.__log_debug("TN3270E")
21262128
if self.use_tn3270e:
21272129
self.send_will(40, buffer=True)
21282130
else:
21292131
self.send_wont(40, buffer=True)
21302132

21312133
elif data[2] == 0: # TRANSMIT-BINARY
2134+
self.__log_debug("TRANSMIT-BINARY")
21322135
if opt not in self.local_will:
21332136
self.send_will(0, buffer=True)
21342137

21352138
elif data[2] == 24: # TERMINAL-TYPE
2139+
self.__log_debug("TERMINAL-TYPE")
21362140
if opt not in self.local_will:
21372141
self.send_will(24, buffer=True)
21382142

21392143
elif data[2] == 25: # END-OF-RECORD
2144+
self.__log_debug("END-OF_RECORD")
21402145
if opt not in self.local_will:
21412146
self.send_will(25, buffer=True)
21422147

21432148
if opt not in self.local_do:
21442149
self.send_do(25, buffer=True)
21452150

21462151
elif data[2] == 46: # START_TLS
2147-
if not hasattr(self.__loop, "start_tls"):
2152+
self.__log_debug("START_TLS")
2153+
ssl_never = os.environ.get("SESSION_SSL") == "NEVER"
2154+
if ssl_never or not hasattr(self.__loop, "start_tls"):
21482155
self._log_warn("START_TLS unsupported.")
21492156
self._log_warn("Python >= 3.7 required")
21502157
self.send_wont(data[2], buffer=True)
@@ -2157,6 +2164,7 @@ def _process(self, data):
21572164
self.send_sub(b"\x2e\x01", buffer=True)
21582165

21592166
else:
2167+
self.__log_debug("timing mark?")
21602168
# e.g. Timing mark (6)
21612169
self.send_wont(data[2], buffer=True)
21622170

0 commit comments

Comments
 (0)