Android app with SSL

I know that this topic has been asked many times, but, unfortunately, in my case none of them work. Over the past few days, I tried to bring it to a functional state, but I failed every time, so I finally came here to ask.

I have a web service on a server with a self-signed certificate. I can access the wsdl file if I enter the address in the browser. The browser just reminds me that there are some problems with the certificate. and if I click continue, everything will work. Unfortunately, I know very little about SSL, because the first time I made an application with SSL communication. In the application, I get the exception “No peer certificate” or “Trust anchor path not found” depends on the type of “solution” I used.

I ran a test on sslhopper.com and I get a warning that "the certificate is not trusted in all browsers. You may need to install an intermediate / chain certificate to associate it with a trusted root certificate." Is this a serious problem in Android development, or can it be solved with some code?

So my question is actually, how can I do in the application do "click" Continue "or something so that it actually connects to the server. In this case, the problem is with the certificate itself or am I doing something wrong in the application ?

+4
source share
1 answer

If you are trying to authenticate a client, you need two things:

  • CA certificate that issued the server certificate
  • client certificate for your application.

You must put 1. in the trust store and 2. in the key store for your application. Sample code expects PCKS # 12 as a keystore, do you have one? What files did you receive? At this point, it would be nice to read the JSSE link so that you understand how the system works:

http://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html

+1
source

Source: https://habr.com/ru/post/1439165/


All Articles