doronz88 / pymobiledevice3

Pure python3 implementation for working with iDevices (iPhone, etc...).
https://discord.gg/52mZGC3JXJ
GNU General Public License v3.0
1.51k stars 209 forks source link

tunnel_service.py", line 445, in start_tcp_tunnel ctx = SSLPSKContext(ssl.PROTOCOL_TLSv1_2) TypeError: 'NoneType' object is not callable #1096

Open xdeng opened 5 months ago

xdeng commented 5 months ago

Test environment

Describe the bug A clear and concise description of what the bug is.

main.py remote start-tunnel -p tcp

tunnel_service.py", line 445, in start_tcp_tunnel ctx = SSLPSKContext(ssl.PROTOCOL_TLSv1_2) TypeError: 'NoneType' object is not callable

doronz88 commented 5 months ago

The tcp tunnels aren't something that is officially supported cross-platform. Use the default QUIC instead

xdeng commented 5 months ago

@doronz88

in Ubuntu 22.04.4 LTS

sudo pymobiledevice3 remote start-tunnel -p tcp

File "/usr/local/lib/python3.10/dist-packages/pymobiledevice3/remote/tunnel_service.py", line 446, in start_tcp_tunnel reader, writer = await asyncio.open_connection(sock=sock, ssl=ctx, server_hostname='') File "/usr/lib/python3.10/asyncio/streams.py", line 48, in openconnection transport, = await loop.create_connection( File "/usr/lib/python3.10/asyncio/base_events.py", line 1103, in create_connection transport, protocol = await self._create_connection_transport( File "/usr/lib/python3.10/asyncio/base_events.py", line 1133, in _create_connection_transport await waiter File "/usr/lib/python3.10/asyncio/sslproto.py", line 682, in _process_write_backlog ssldata = self._sslpipe.do_handshake( File "/usr/lib/python3.10/asyncio/sslproto.py", line 122, in do_handshake ssldata, appdata = self.feed_ssldata(b'', only_handshake=True) File "/usr/lib/python3.10/asyncio/sslproto.py", line 188, in feed_ssldata self._sslobj.do_handshake() File "/usr/local/lib/python3.10/dist-packages/sslpsk_pmd3/sslpsk.py", line 127, in do_handshake super().do_handshake(*args, **kwargs) File "/usr/lib/python3.10/ssl.py", line 975, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: NO_CIPHERS_AVAILABLE] no ciphers available (_ssl.c:1007)

tcp tunnels only available on Mac?

doronz88 commented 5 months ago

even not on mac. i don't know of a rule of thumb where they work. they do on all my workstations (even windows/linux) and users have reported otherwise so dunno feel free to submit a PR to fix that