Android application with SSL - android

I know that this particular topic was asked many times, but unfortunately in my case none of them are working. For past few days I was trying to get it to functional state, but I failed every time, so I finally come here to ask.
I have a webservice on server with self-signed certificate. I can access wsdl file if I enter address into browser. Browser just remind me, that there is some issues with cert. and if I hit continue, everything works. Sadly I know very little about SSL, because its first time I made an application with SSL communication. In application I'll only get exception "No peer certificate" or "Trust anchor path not found" depends on type of "solution" I used.
I ran test on sslhopper.com and I get a warning that "The certificate is not trusted in all web browsers. You may need to install an Intermediate/chain certificate to link it to a trusted root certificate." Is this a serious issue in Android development or it could be resolved by some code?
So my question is actually, how can I do in application make "hit the continue button" or anything to make it actually connected to the server. In this case is it problem with certificate itself or am I doing something wrong on the application itself?

If you are trying to do client authentication, you need two things:
the CA certificate that issued the server certificate
a client certificate for your app.
You have to put 1. in the trust store and 2. in the keystore for your app. The sample code expects a PCKS#12 as the keystore, do you have one? What files have you been given? At this point it might be good to read the JSSE reference so you have an idea how the system works:
http://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html

Related

Ionic Android app has no internet access on signed release apk but debug works fine

My app works fine in the debug apk, but as soon as I build and sign a release version, my app has no internet access and no requests work. All requests are made over https.
My server uses https on nginx to reverse proxy requests to a node.js server. I looked at other issues and they say it has something to do with interimediate ssl certificate problems on the server. I'm rather new to configuring ssl and I'm not sure what that means or how to fix it, but the server works fine normally over https.
Sorry, I got this fixed a long time ago. I contacted Comodo customer support and they gave me the correct root and intermediate certs to use. I guess there's something that blocks ssl certificates that don't have a full keychain back to the CA.
So anyone else having this issue, just contact your CA and ask them for the proper intermediate and/or root certificates.

What's the process with SSL certificate with Volley on Android

I'm developing an Android App which requests a server with https. So the server has a certificate. During development I've managed to trust all certificates to not care about that at this stage of the project.
As I'm preparing the production phase, I would like to know how do I use volley with https, by verifying the authenticity of the server. Should I import something in the App ? May someone explains me how it works ?
Please don't give me just a tutorial to follow, I've found some already but I'm facing difficulties to understand the process, some explanations would be great !
Thanks a lot !
As long as the certificate comes from a valid Certificate Authority (CA) it will work as is.
This is the same with all android https connections.
You do not need to install certificates etc on the android device.
(You should double check the CA you are using is valid on the android as there are some that may not be compatible this easily. Although the majority should be)

Ignore SSL certificate in Android *for an existing app*

Not gonna go into details about what I'm attempting to achieve here (which is not really about writing programs), but when using an existing Android app, I hit a wall which translates to the following in ADB logcat:
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
It seems like the app somehow won't trust the remote server, so I searched for solutions to bypass this, but as far as what I've seen, the results are all about how to work around it when you're developing, i.e. when you have the source code of the app itself. The situation here is that I'm never going to have the privilege to get the source for the app, so what I'm looking for is a solution that can work around it for an existing app. An app/plugin to do this is okay, or even a way to reverse engineer the APK I have and add in the stuff I need - you say it, people upvote it, and I go learn it.
Thanks for your time for reading through a newbie's first question here!
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
It seems like the app somehow won't trust the remote server,...
No peer certificate means that the server did not send a certificate at all. So the usual methods of ignoring the result of the certificate validation will not help, because if there is no certificate there is no validation. Since the application seem to expect a certificate this looks more like a misconfigured server.

How to manage HTTPS on a dev machine, with android?

As HTTPS requires a certificate and a dns name, how are you supposed to work on your dev machine ?
Do you need a specific certificate and a dns name for your machine ?
I generated self signed certs but it causes too many problems with android with sslv3/poodle:
1/ You have to put some code to accept your self signed cert. I followed the recommendation from google, here.
2/ When you apply this and have a server, nginx, not supporting sslv3 which is good as sslv3 has a flaw, you get an exception saying that it tried to negotiate sslv3 but failed.
3/ Then there are some rare advices on how to bypass the sslv3 issue by providing a modified socketFactory. See this post for example. But mixing 1/ with this becomes very difficult for me.
Any advice appreciated. Thanks!

android ksoap2 - Not trusted server certificate

I use ksoap2 to access a webservice. Everything was just fine before to change the test webservice with production one, witch use a https protocol.
I know that this question was asked few more times here, on stackoverflow, but none of the answers work for me. When I use ksoap2 with https I got this error (exception):
Not trusted server certificate
Someone provided and answer (solution) here: Android ksoap2 via https but I don't understand how to implement that solution (or the proposed solution is not working for me)
The certificate used by WS is a self issued ssl certificate - I use the application only inside a small company, but the company system administrator requires encrypted connection.
Can someone provide a better explanation for this issue?
Thank you.
I had a similar problem. Basically, when using Http related classes with the https protocol, Android will check with its installed certificates(which I believe are stored in the os keystore).
Because your certificate is self-signed, the certificate is not trusted.
I added my self-signed certificate to my app for testing purposes(alexander.egger's answer at How to install trusted CA certificate on Android device?). Maybe you can use this approach?
I guess Vedran's approach at Android ksoap2 via https does a similar thing and should work too. What part of that answer is unclear?
However, I dont think these are good solutions.
For my production environment, I ordered a (cheap) ssl certificate from a signing authority trusted by all Android devices and installed it on the server. I am not going to advertise here, but most commercial ssl certificates are trusted by all android devices, and it should be easy to find a cheap one with some research. I think this is the best solution to this problem.
Without a proper ssl certificate, your server would be untrusted to the entire world except your particular app, which is probably not a good solution(what if you extend to an ios device, a third party application calling the webservice,etc..).

Categories

Resources