Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Oct 19, 2024
1 parent fb9093c commit af8f8e8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pymobiledevice3/remote/tunnel_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,18 @@ async def start_tcp_tunnel(self) -> AsyncGenerator[TunnelResult, None]:
port = parameters['port']
sock = create_connection((host, port))
OSUTIL.set_keepalive(sock)
ctx = SSLPSKContext(ssl.PROTOCOL_TLSv1_2)
ctx.psk = self.encryption_key
ctx.set_ciphers('PSK')
if sys.version_info >= (3, 13):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
ctx.maximum_version = ssl.TLSVersion.TLSv1_2
ctx.set_ciphers('PSK')
print('COPOL!!!!!')
ctx.set_psk_client_callback(lambda hint: (None, self.encryption_key))
else:
ctx = SSLPSKContext(ssl.PROTOCOL_TLSv1_2)
ctx.psk = self.encryption_key
ctx.set_ciphers('PSK')
reader, writer = await asyncio.open_connection(sock=sock, ssl=ctx, server_hostname='')
tunnel = RemotePairingTcpTunnel(reader, writer)
handshake_response = await tunnel.request_tunnel_establish()
Expand Down

0 comments on commit af8f8e8

Please sign in to comment.