Self-signed certificates not accepted by Android client #65
Labels
No labels
bug
dependencies
duplicate
enhancement
good first issue
help wanted
invalid
question
waiting for fix validation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mia/bumper#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After installing Bumper via git-clone and 'pipenv install' successfully on a Debian Buster virtual machine, I fired it up. Certificates were generated automatically. I created a passwd file inside the bumper subdirectory, since Bumper was complaining that it was missing. After killing and restarting it, I still get two (unrelated?) warnings,
[2019-12-27 00:17:01,149] :: WARNING :: hbmqtt.client :: MQTT connection failed: ConnectionRefusedError(111, "Connect call failed ('192.168.10.42', 8883)") [2019-12-27 00:17:01,149] :: WARNING :: hbmqtt.client :: Connection failed: ConnectException(ConnectionRefusedError(111, "Connect call failed ('192.168.10.42', 8883)"))but it's running.
It seems my DNS-spoofing for (mq-ww.ecouser.net, portal-ww.ecouser.net, gl-de-openapi.ecovacs.com, msg-ww.ecouser.net, bigdata-china.ecovacs.com and others) seems to be working as intended.
Describe the bug
When trying to connect the Ecovacs HOME V1.3.1 app (Android 8.0.0 and SM-N950F, also tried other devices) I get many errors:
101,-9005
103,-9005
204,-9005
,-9005
016,-9005
003,-9005
020,-9005
207,-9005
The app tries to connect to the HTTPS service on port 443 which hands out the self-signed certificate formerly created. Obviously that certificate is rejected by the app, since the client replies "TLSv1.2 Record Layer: Alert (Level: Fatal, Description: Certificate Unknown)" and ends the connection.
Installing the CA-Certificate manually on the Android client didn't help.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Ecovacs HOME app connects to bumper.
Screenshots
-- unable to paste one --
Desktop (please complete the following information):
Smartphone (please complete the following information):
Vacuum (please complete the following information):
Additional context
The passwd file missing is okay, and creating it may break things (I need to test this).
Your issue may be related to #43. @aharter looked into this and some additional details for Android 7+ were added in the docs but it appears to require root:
https://github.com/bmartin5692/bumper/blob/master/docs/Use_With_App.md#android-7-and-up-requires-root
I don't have a newer android device to test against, but the above may be worth a try.
Ok, so I removed it (without any effect on the SSL problem, just as expected)
That's exactly how I dit it. My phone is rooted and I followed the instructions provided here: https://ivrodriguez.com/installing-self-signed-certificates-on-android to copy the ca.crt directly into /system/etc/security/cacerts/.
Initially I had some difficulties because I accidentally changed the permissions of the cacerts directory, which made ALL my cacerts disappear to the system. This issue is sorted meanwhile, though.
Another problem was that the Bumper certificate obviously did not include the FQDN but just the plain hostname. After adding (via Bumper_SAN.txt) the FQDN, I can now connect to port 443 using chrome without any complaints.
However I still can't get EcovacsHOME to connect. It's throwing the same errors as before.
Could you run with --debug and provide the output of confserver.log? Also what region/country are you running as? I know @uchagani also has a Ozmo950 and his is now working.
I've already tried that a couple of times. There's little in there:
(Repeats for every start of bumper, of course)
From the wireshark capture I can however clearly see that the client (192.168.10.218) contacts the bumper confserver (192.168.10.42:443), requested server hostname is "gl-de-openapi.ecovacs.com" and the server side replies correctly with Server Hello, Certificate, Server Key Exchange and Server Hello Done. The next message from the client is that fatal "Certificate Unknown".
I have yet to dig down into the code of confserver but I suppose, the connection fails at such an early stage (TLS handshake) that confserver itself doesn't really get any of it...
That makes sense, definitely related to the certs and your device. Do you have another device you can try it from?
On my SM-T825 (Also Android 8) I get the exact same results. I'll try to get my hands on an older device to see whether it behaves differently.
I do however have another Idea. I have a feeling that this might be related to the client not accepting the altname "*.ecovacs.com" but instead require "gl-de.openapi.ecovacs.com" to be explicitly listed. I'm currently modifying the create_certs.go to ease experimenting with the server cert without generating a new ca cert.
I noticed that your tutorial uses
-subject_hashto name the certificate, whereas I used-subject_hash_old(as it is described here: https://docs.mitmproxy.org/stable/howto-install-system-trusted-ca-android/).Not sure if that makes a difference, since the certificate seems to be accepted in chrome.
I would never have believed it, if I hadn't seen it with my very eyes... The "-subject_hash_old" really did the trick!
Thanks a million!!!