I am working on an application in which i have to post certain data via HTTPS services. I am using a self signed certificate
If you are using HttpURLConnection
, OkHttp
, or HttpClient
, you can create an SSLContext
that uses a TrustManager
that supports your self-signed certificate. I have some support for this with my TrustManagerBuilder
in my CWAC-Security library, and there are plenty of examples of how to do this yourself, such as this blog post, by searching for android sslcontext self-signed
in your favorite search engine.
If you are using some library for HTTP access, find out where you can configure its SSL functionality, or contact the author of that library if there does not seem to be an option for this.
Is there any way to add this certificate at "system" level in android rather than at "user" level ?
Users can install certificates. I am not aware that apps can install certificates, though I cannot rule it out. However, unless this certificate is needed for other apps, not just yours, please just use the certificate from your own app.