Skip to content

Commit c35a05c

Browse files
authored
preserve ssl wrap_bio port state consistently
1 parent 6524dd9 commit c35a05c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mocket/ssl/context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ def wrap_bio(
125125

126126
effective_host = hostname if hostname is not None else current_host
127127
ssl_obj._host = effective_host
128+
if current_port is not None:
129+
ssl_obj._port = current_port
128130
if effective_host is not None and current_port is not None:
129131
ssl_obj._address = (effective_host, current_port)
130-
ssl_obj._port = current_port
131132
return ssl_obj
132133

133134

0 commit comments

Comments
 (0)