Testing ODK Collect with a Custom Server and Self Signed Certs and Authentication

Hi, up until the change to the HTTPClient software in ODK Collect I was able to develop and test new forms (both downloaded from and submitted to our custom PHP Symfony server) by using HTTP on port 8443. This got around the clear text password issue, as the server uses HTTP Basic for authentication when talking with ODK Collect. I run Android Studio, the phone emulator and the full server development environment on the same (mac os) laptop.

This no longer works, and I can no longer connect to a development server from the Android Emulator. If I don't use TLS I get no access, if I run my dev server with a self signed cert, ODK Collect doesn't trust it.

Does anyone have a similar set up and any solutions to how I can still develop and test forms on a dev system? (The forms are created from Twig templates, then after being completed on ODK Collect are uploaded and parsed by a custom service.)

Thanks,
Richard

Hi all,

Is no one else using a custom server? If so how are you connecting in dev? Any help much appreciated.

Thanks and Regards,
Richard

You can use ngrok to expose an HTTPS URL that Collect can connect to. For example, if your local server is running on port 80, you can run ngrok http 80 and use the provided temporary URL in Collect.

I linked to a page that I find is a helpful introduction to the tool but it makes it look very enterprise-y. The basic ngrok tool is open source. Downloads are here and you can find its github page at https://github.com/inconshreveable/ngrok.

1 Like

Hi Hélène Martin,

Thank you very much for that, works a treat :slight_smile:

Regards,
Richard

1 Like

I made it work by customising the android code and allowing unsafe ssl certificates by using the following stackoverflow link

since i was using the docker version of odk central so i couldn't get through the nginx certificates. You can place the code to org.odk.collect.android.openrosa.okhttp.okHttpConnection.java

Hi for me it gave to many redirects