A listing of random software, tips, tweaks, hacks, and tutorials I made for Ubuntu

How to fix lockdown error -5 on usbmuxd

When I plug my iPhone in (iOS 9), usbmuxd (and hence libimobiledevice-related software) runs just fine, but when I plug my older iPad in (iOS 5), I get this error:

[18:51:51.199][3] Connected to v2.0 device 1 on location 0x20009 with serial number ("random" string of numbers)
[18:51:51.867][1] preflight_worker_handle_device_add: ERROR StartSession failed on device (same "random" string of numbers), lockdown error -5

I spent quite a long time trying to fix this issue. I tracked down this file, that contains this line:


So it’s an SSL-related issue, and it happens with an older device, and not a newer one … figured it might be the certificates, and, since I haven’t connected my iPad to the internet for a while, decided to give that a shot. Same issue. But hey, it was fun being able to use Cydia! (at the time of writing, there is no public jailbreak for iOS >=9.2)

After a while of playing with certificates on my host computer (with the same luck), I decided to try compiling both libimobiledevice and usbmuxd with debug flags.

Right off the bat, I got my first (and only) compiler error: undefined reference to 'SSLv3_method' (or something like that).

Turns out that OpenSSL disables SSLv3 by default, for security reasons. After changing SSLv3_method to SSLv23_method (as per this patch) and enabling debug flags, I found that, indeed, the problem relied exactly where the compiler error was:

19:11:34 idevice.c:722 idevice_connection_enable_ssl(): ERROR in SSL_do_handshake: SSL_ERROR_SSL

Thankfully, libimobiledevice contains support for GnuTLS, which, also thankfully, still supports SSLv3! Although there were a few compiler errors because I’m guessing nobody really used the GnuTLS backend for some time, once it was built, I finally managed to make usbmuxd (and libimobiledevice-using software) recognize my iPad!

EDIT: libimobiledevice fixed the compiler errors upstream.

So, if you encounter this error, here’s how you fix it:

git clone
cd libimobiledevice
./ --prefix=/usr --disable-openssl
sudo make install

I hope this can help someone else with this issue! If you have any problems, feel free to leave a comment and I’ll try my best to help!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: