0

Our team has the following problem:
We are developing a client-application for android and iOS using Unity + UniWebview + HTML. This app includes Ajax-requests to some servers via jQuery. For testing purposes we're using a testing server instead of the live server. This testing server uses a self-signed SSL-certificate. NOTE: We have no access to that server, so changing the SSL-certificate is likely not an option.
When testing the .htm-file locally with the desktop browser we just did import that SSL-certificate to Chrome and Mozilla Firefox. With this approach our HTML-code worked as expected.

Now we wanted to test it in our UniWebview environment on an android device. Intially the app didn't work. As we tested the .htm-file in the mobile chrome browser, the requests were blocked because of the not trusted SSL-certificate. So we went looking for a solution on how to import the certificate to Android.

The most common solution we found, was exporting the certificate in chrome or firefox and copying it to the SD-card drive of the device. Then: Settings > Security > Install from USB-Storage, then select the certificate and install it. After the installation we got the message of a successful installation. But when looking for it in the list of user certificates, it doesn't show up. After testing our script again it also still doesn't work. We gave this solution a couple of tries by experimenting with different formats and encodings, but everytime we got the same result.

The second try was using the application CAdroid for importing SSL-certificates to Android. But there we also encountered a problem. At step 4 (checking of the certificate) we got an errormessage that the basic constraints are missing. Therefore there is no CA-flag set, therefore the CA-flag isn't true.

The third try was using the Android-emulator of the Android-SDK. This time we got the same problem as in our first try, when installing the certificate directly to Android.

TL;DR
So my quesiton: Is it possible to install this self-signed certificate to Android without having a set CA-flag?
If not, is it possible to modify that existing certificate, so it can be installed?
NOTE: Creating a new certificate is NOT a real option.
NOTE: We only have the certificate-files, we exported with chrome and firefox
I found this post: self-signed certificate install claims success, but android acts as if cert isn't there . In the comments there is some discussion about modfying an exisiting certificate, although I am not sure if this is an option for us.

Testing device: Samsung GT-N8010 (Galaxy Note 10.1) Android 4.4.2

Best Regards

0

Is it possible to install this self-signed certificate to Android without having a set CA-flag?

Android uses OpenSSL (or the fork BoringSSL in later versions) as the underlying SSL stack. OpenSSL will not accept a self-signed certificate unless the CA flag is true, because even a self-signed certificate must have the correct flags so that it can sign itself (i.e. CA flag). So even if you would be able to install the certificate it will not be used as the trust anchor for validation, i.e. the validation will fail.

If not, is it possible to modify that existing certificate, so it can be installed? NOTE: Creating a new certificate is NOT a real option.

No, you cannot modify an existing certificate. You could probably re-create the certificate if you have access to the original certificate and the private key.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.