Tasker 5.2 no longer trusts user certificates

241 views
Skip to first unread message

Ben Winslow

unread,
Aug 2, 2018, 8:27:20 PM8/2/18
to Tasker
Hi there!

Since updating to Tasker 5.2*, user CA certificates (i.e. CA certificates that have been manually added to the system and appear under system settings -> security (exact location varies) -> view security certificates -> user) are no longer honored when using the "HTTP <method>" network actions or XMLHttpRequest inside a JavaScript(let) action.

I believe this is due to the new release bumping targetSdk to 25 combined with the changes described in https://android-developers.googleblog.com/2016/07/changes-to-trusted-certificate.html (user certificates are no longer trusted by default for targetSdk >= 24).  I believe the solution is to add a networkSecurityConfig to the app manifest (https://developer.android.com/training/articles/security-config), and in the networkSecurityConfig xml use the snippet under "Trusting user-added CAs for all secure connections" in the Android developers blog post.


More details:
https requests using a certificate that's signed with a CA certificate that only exists in the user CA store behave as if the CA isn't found at all (the same behavior you'd expect for a self-signed certificate); for example, the error log from an "HTTP GET" action:

19.10.10/E prot: https:// serverport: <hostname>:443 contenttype: 
19.10.10/E method: GET url: https://<hostname>:443/foo timout: 10000 dataisfile false save null
19.10.10/WakeLockManager acquired partial lock for M flags: 1 autorelease: true warn: true
19.10.10/WakeLockManager setClearAlarm: not setting, last set 31ms ago
19.10.10/WakeLockManager setClearAlarm: not setting, last set 54ms ago
19.10.10/E body isfile: false cont: null
19.10.11/E Input/Output error for https://<hostname>:443/foo: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found..
19.10.11/E result: stop task (error)
19.10.11/E Error: 1
19.10.11/MacroEdit action finished exeID 1 action no 0 code 118 status: Err next 0

I could, of course, use the "Trust Any Certificate" option -- but this is insecure and doesn't help for the Javascript actions which are my primary use case.

Device: Samsung Galaxy S8 (stock OS)
Build fingerprint: 'samsung/dreamqlteue/dreamqlteue:8.0.0/R16NW/G950U1UES5CRF5:user/release-keys'
Tasker version: 5.2.bf1
* I'm not 100% sure this happened with 5.2, but that version makes the most sense based on the changelog and time of my last successful connection.  Incidentally, a variable with the Tasker version would be handy so that I can log it on the server side.  :)

Cheers,
-- 
Ben

João Dias

unread,
Aug 3, 2018, 10:45:15 AM8/3/18
to tas...@googlegroups.com
Hi, thank you very much for your report.


Let me know how it works :) Thanks!

Ben Winslow

unread,
Aug 3, 2018, 3:47:04 PM8/3/18
to Tasker
That did the trick!  Thank you very much! 

-- 
Ben

João Dias

unread,
Aug 6, 2018, 3:22:47 AM8/6/18
to tas...@googlegroups.com
Great :D Let me know if there are any side effects. Thanks!

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Rijoy Bhaskaran

unread,
Aug 22, 2018, 6:11:35 PM8/22/18
to Tasker
So the work around is to us this version of app ? 

João Dias

unread,
Aug 23, 2018, 8:29:05 AM8/23/18
to tas...@googlegroups.com
This version is already in beta, so you can use that :)
Reply all
Reply to author
Forward
0 new messages