Secure ADB Connection Fails with SSL Error: Reconfigure CLI with Valid API Key
Android
If your Secure ADB connection fails with an [SSL: UNEXPECTED_EOF_WHILE_READING] error, the issue is usually caused by an expired API key, incorrect tenant name in your CLI configuration, or ADB access being disabled on the device. Follow these steps to resolve the problem.
Before you begin
Make sure you have:
- Access to the Esper Console as an Enterprise Admin
- The Esper CLI installed on your machine
- The device serial number or name you want to connect to
Step 1: Enable ADB access on the device
- Log in to the Esper Console.
- Go to Devices & Groups and select your device.
- Open the Settings tab.
- Confirm that ADB access is enabled for the device.
ADB must be explicitly enabled per device before you can establish a Secure ADB session.
Step 2: Generate a new API key
- Log in to the Esper Console as an Enterprise Admin.
- Navigate to API Key Management.
- Generate a new API key.
- Copy the key immediately — you won't be able to view it again.
Step 3: Reconfigure the Esper CLI
- Open your terminal or command prompt.
- Run the following command:
espercli configure - At the prompts, enter:
-
Environment name: Your tenant name (for example,
acme, not the full URL) - Esper API Key: The newly generated API key from Step 2
-
Environment name: Your tenant name (for example,
Step 4: Test the Secure ADB connection
- Run the following command, replacing
<DEVICE_NAME>with your device's name:espercli secureadb connect -d <DEVICE_NAME> - If successful, the CLI will print a local port binding, for example:
Secure ADB session established on 127.0.0.1:12345 - Verify the connection by running:
adb connect 127.0.0.1:<port>
If the connection succeeds, you now have ADB shell access to your device.
Troubleshooting if the error persists
If you still see the SSL error after reconfiguring your CLI, try the following:
-
Check your network: Confirm that outbound traffic to
*.esper.cloudon TCP ports 40000–50000 is allowed. This applies even if your local network wasn't the original cause. - Verify your credentials: Double-check that the API key is valid, not expired, and belongs to an Enterprise Admin account. Keys from lower-privilege accounts may fail silently at the session layer.
-
Enable debug mode: Run the command with the debug flag to see more details:
espercli -D secureadb connect -d <DEVICE_NAME>
Still need help?
If the SSL error persists after following all steps above, contact Esper Support. include:
- The full debug output from
espercli -D secureadb connect -d <DEVICE_NAME> - Your espercli version (run
espercli --version) - Your device serial number or ID
- Confirmation that ADB is enabled in the Esper Console for the device
0
Please sign in to leave a comment.
Comments
0 comments