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

**URL:** <https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571>\
**Category:** Development\
**Tags:** odk-collect\
**Created:** [March 19, 2020, 7:33pm UTC](https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571 "2020-03-19T19:33:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rik702](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/rik702/32/1741_2.png) [@rik702](https://forum.getodk.org/u/rik702)\
**Post date:** [March 19, 2020, 7:33pm UTC](https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571/1 "2020-03-19T19:33:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rik702](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/rik702/32/1741_2.png) [@rik702](https://forum.getodk.org/u/rik702)\
**Post date:** [March 21, 2020, 4:13pm UTC](https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571/2 "2020-03-21T16:13:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [March 23, 2020, 4:34pm UTC](https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571/3 "2020-03-23T16:34:14Z")

</div>

You can use [`ngrok`](https://ngrok.com/product) 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](https://ngrok.com/download) and you can find its github page at [https://github.com/inconshreveable/ngrok](https://github.com/inconshreveable/ngrok).

---

<div class="post-metadata">

**Author:** ![rik702](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/rik702/32/1741_2.png) [@rik702](https://forum.getodk.org/u/rik702)\
**Post date:** [March 23, 2020, 6:35pm UTC](https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571/4 "2020-03-23T18:35:17Z")

</div>

Hi Hélène Martin,

Thank you very much for that, works a treat 🙂

Regards,  
Richard

---

<div class="post-metadata">

**Author:** ![Shashwat\_Singh](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/shashwat_singh/32/13300_2.png) [@Shashwat\_Singh](https://forum.getodk.org/u/Shashwat_Singh)\
**Post date:** [October 6, 2020, 7:21pm UTC](https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571/5 "2020-10-06T19:21:57Z")

</div>

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

> <https://stackoverflow.com/questions/25509296/trusting-all-certificates-with-okhttp>

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

---

<div class="post-metadata">

**Author:** ![Clerio\_Faife](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/clerio_faife/32/15874_2.png) [@Clerio\_Faife](https://forum.getodk.org/u/Clerio_Faife)\
**Post date:** [July 19, 2021, 6:26pm UTC](https://forum.getodk.org/t/testing-odk-collect-with-a-custom-server-and-self-signed-certs-and-authentication/25571/6 "2021-07-19T18:26:32Z")

</div>

Hi for me it gave to many redirects
