Jump to content

Deploying certificate with your Android app

Recommended Posts



I have my HTTPS proxy for my HTTP REST server. Both running on my development computer.


I setup HTTPS proxy following instructions here: https://twigstechtips.blogspot.com/2016/01/nginx-how-to-set-up-ssl-reverse-proxy.html


These instructions makes you generate two certificate files. KEY and PEM files. I added that PEM file in my project resources as resource type RCDATA and used identifier "my_ca".

I used below link to prepare my security config xml



Using "@raw/my_ca" as in that stackoverflow question is failing with below error (while packaging the app) when I try to debug run the app.

network_security_config.xml:6: error: Error: No resource found that matches the given name (at 'src' with value '@raw/my_ca/')

So, I prepared my XML file as following:

<?xml version="1.0" encoding="utf-8"?>
    <domain includeSubdomains="true">yourdomain.com</domain>
      <certificates src="my_ca"/>


When I try to access my REST server like 

I get following error

Failed to parse XML configuration from network_security_config

On the other hand, I can get results just fine using identical URL and Postman on Windows OS.


I simply failed to figure how to add that self signed certificate in my app package and use it.


Any help is appreciated.


Thanks & Regards,



Share this post

Link to post

I did add private key certificate as a resource as I tried to explain in my initial post.


I did deploy my security config "network_security_config.xml" under "res\xml" in project Deployment. Sorry, forgot to mention that in detail.


BTW, I am not trying to deploy my app in Play Store. Just trying to deploy it with my self signed HTTPS certificate.

Share this post

Link to post

your "server HTTPS" know your certiface? and the answer is "all it's ok" can pass please!

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now