Skip to content

No connection with iOS 15.1 #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
everlanes opened this issue Nov 7, 2021 · 11 comments
Closed

No connection with iOS 15.1 #383

everlanes opened this issue Nov 7, 2021 · 11 comments

Comments

@everlanes
Copy link

I want to debug a webpage on Apple iPhone XR with iOS 15.1

I compiled all libimobiledevice dependencies using the GIT repositories with latest commits.

When I start the ios_webkit_debug_proxy I get the following error messages:

./bin/ios_webkit_debug_proxy -d
ss.add_server_fd(3)
Listing devices on :9221
ss.add_fd(4)
ss.add_server_fd(5)
ss.remove_server_fd(5)
ss.recv fd=4 len=960
ss.add_server_fd(5)
ss.add_fd(9)
wi.send_packet[197]:
 00 00 00 C1 62 70 6C 69 73 74 30 30 D2 01 03 02 04 5A 5F  ....bplist00.....Z_
 5F 73 65 6C 65 63 74 6F 72 5F 10 16 5F 72 70 63 5F 72 65  _selector_.._rpc_re
 70 6F 72 74 49 64 65 6E 74 69 66 69 65 72 3A 5A 5F 5F 61  portIdentifier:Z__a
 72 67 75 6D 65 6E 74 D1 05 06 5F 10 1A 57 49 52 43 6F 6E  rgument..._..WIRCon
 6E 65 63 74 69 6F 6E 49 64 65 6E 74 69 66 69 65 72 4B 65  nectionIdentifierKe
 79 5F 10 3B 33 37 33 33 30 33 39 32 37 61 36 66 66 38 62  y_.;373303927a6ff8b
 30 2D 33 61 62 33 65 61 63 37 2D 34 34 37 36 2D 62 66 66  0-3ab3eac7-4476-bff
 64 2D 63 65 33 62 32 32 65 35 31 66 35 34 65 65 63 33 63  d-ce3b22e51f54eec3c
 64 64 39 61 31 66 08 0D 18 31 3C 3F 5C 00 00 00 00 00 00  dd9a1f...1<?\......
 01 01 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 00 00  ...................
 00 00 00 00 00 00 9A                                      .......
ss.failed fd=9
ssl send failed: Success
Unable to send 197 bytes to inspector
ss.remove_server_fd(5)
Unable to connect to $DEVICENAME ($DEVICE_ID)
  Please verify that Settings > Safari > Advanced > Web Inspector = ON
ss.remove_fd(9)
Unable to report to inspector $DEVICE_ID

Any chance that this might work?

Versions:

  • usbmuxd v1.1.1
  • ios_webkit_debug_proxy 1.8.8
  • libusbmuxd 2.0.0
  • libusb 1.0.24
  • libplist 2.2.0
  • libimobiledevice-glue 1.0.0
  • libimobiledevice 1.3.1
@everlanes
Copy link
Author

I tried to debug it a bit further, but I am not experienced with neither OpenSSL debugging nor the Apple protocols and usbmuxd.

Here are some more information. I added debug output to src/socket_manager.c:

sm_status sm_send(sm_t self, int fd, const char *data, size_t length,
    void* value) {
    [...]
        sent_bytes = SSL_write((SSL *)ssl_session, (void*)head, tail - head);
        if (sent_bytes <= 0) {
          if (SSL_get_error(ssl_session, sent_bytes) != SSL_ERROR_WANT_READ &&
              SSL_get_error(ssl_session, sent_bytes) != SSL_ERROR_WANT_WRITE) {
            sm_on_debug(self, "ss.failed fd=%d error=%d errno=%d", fd,
                SSL_get_error(ssl_session, sent_bytes), errno);
            SSL_SESSION_print_fp(stderr, SSL_get_session((SSL *)ssl_session));
            sm_on_debug(self, "mode %d", SSL_get_verify_mode((SSL *)ssl_session));
            perror("ssl send failed");
            return SM_ERROR;
          }
          break;

Output when running this modified version:

ss.failed fd=9 error=5 errno=0
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: [..removed..] 
    Session-ID-ctx: 
    Master-Key: [..removed..]
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1636370246
    Timeout   : 7200 (sec)
    Verify return code: 21 (unable to verify the first certificate)
    Extended master secret: yes
mode 0
ssl send failed: Success

SSL_get_error returns value 5: SSL_ERROR_SYSCALL - from the openssl man page

Some non-recoverable, fatal I/O error occurred. The OpenSSL error queue may contain more information on the error. For socket I/O on Unix systems, consult errno for details. If this error occurs then no further I/O operations should be performed on the connection and SSL_shutdown() must not be called.

errno is 0, so no additional information there.

The ssl session seemes to be open. Only the verify return code of 21 seemse odd. Maybe the SSL Certificates are not correct?

So I also printed the SSL_get_verify_mode. It is mode = 0 meaning the certificate should not be checked.

I guess from here it would need more detailed knowledge of the systems to debug any further.

@beckietech
Copy link

hi @everlanes,

I faced the same issue. do you have any progress? It recurred to me that when upgrading to iOS13 similar issue happens(#314)? Just my humble guess, is there possibility that could be rendering issue?

@everlanes
Copy link
Author

Sorry, no progress. I gave up on this and used inspect.dev for my current problem instead.

@beckietech
Copy link

hi @everlanes,
A new release appium now seems to uspport iOS 15 and other new iOS updates:https://github.com/appium/appium/releases,
are you interested in finding a solution here? Thanks

@brainthinks
Copy link

Running into the same issue - using inspect.dev now, which only works with Safari

@dumbasPL
Copy link

Ios 14.8.1 has the exact same problem

@danrossi
Copy link

This issue keeps happening, Inspect somehow works and was working fine but is now paid. And it does not warrant paying for something I use once or twice a year to debug errors. Is there anything else that works ?

@tsung-sc
Copy link

same issue

@artygus
Copy link
Collaborator

artygus commented Mar 17, 2023

working on this to get rid of dependency of libimobiledevice's openssl

@artygus
Copy link
Collaborator

artygus commented Mar 18, 2023

@mockey
Copy link

mockey commented Mar 22, 2023

This works now on Linux Mint. I can connect to an iPhone with iOS 16.3.1.
That's great! Thanks a lot!

@artygus artygus closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants