call webservice over HTTPs in android using ksoap2 - android

Hi all i am working on web services in android using ksaop2 library, i have done with http but when try over https then i got exception
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
my wsdl file is asking username and password to open
Can you please help me how to call web service over ssl

Related

Connecting to a locally running SignalR .netcore server via android emulator

I have a .netcore SignalR server running locally through ISS express. (https://localhost:44372/secureChat")
I have an Android Emulator running through Android Studio.
For referencing localhost things via the emulator you use the ip 10.0.2.2.
I'm using the microsoft signalR android package: com.microsoft.signalr:signalr
I using the hubConnectionBuilder to connect to: https://10.0.2.2:44372/secureChat
When I attempt to connect I get the following error: java.lang.RuntimeException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
I've found solutions online but none of them relate to SignalR or socket connections.
Alternatively I also have a website that connects to the local signalR server and when I launch the website locally and then host that inside a WebView in android app, it works fine (webview connected at https://10.0.2.2:3000) , but I'm trying to experiment with connecting directly from Android without the webview.
Does anybody have any idea what I need to do to resolve this issue?
The problem is that your android emulator doesn't trust the self signed certificate of iis express, export the certificate to a file, upload to the emulator and follow this link to add the certificate https://support.google.com/nexus/answer/2844832?hl=en

SSLHandshakeException while calling webservice through volley library

I am getting this exception
com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException:
java.security.cert.CertPathValidatorException: Trust anchor for certification
path not found.
from volley while accessing web service in some devices. I have searched a lot, but certificate of SSL is properly inserted in server side. Is there anything else to do in android side?
Thanks in advance.

Enable Xamarins.Forms App to Trust IIS Express Development Certificate

I'm developing my first Xamarin.Forms App and have a backend API built using ASP.Net Core. I want all calls to the API to be via HTTPS so followed this guide for setting up HTTPS for development in ASP.NET Core. This, I believe, will let me use the IIS Express Development Certificate from within Visual Studio.
Up to this point I had been making all calls to the API from my Xamarin.Forms Android App via the emulator using HttpClient and the following http uri
http://10.0.2.2:44321/api/User
but now with SSL enabled for my API I need to make the call from the app using the following uri
https://10.0.2.2:44321/api/User
However, simply changing http to https gives the following error
{Javax.Net.Ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. ---> Java.Security.Cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. ---> Java.Security.Cert.CertPathValidatorException: Trust anchor for certification path not found.
--- End of inner exception stack trace ---
I presume this is because the the Xamarin.Forms App does not list the IIS Development Certifcate as being trusted, i.e., with Swagger (Swashbuckle) running from my API I can hit the endpoint with no problems; with postman running with SSL certificate verification turned off I can also hit the endpoint.
How can I setup a Xamarin.Forms App (specifically Android) to trust the IIS Development Certificate for development purposes?

Empty response from asp.net application on emulator

I can't browse to my web application from visual studio while using a android emulator. I get an empty response error on the browser. When I browse to my local application from my computer, it works. I used the ip 10.0.2.2 on android emulator instead of localhost. Anybody can help me?
Check your console for any errors. I was having this issue and was seeing Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. because my locally issued certificate was invalid.
For development I overrode WebviewClient according to this answer and was able to get it working. Make sure to remove before releasing to production to prevent your application from being susceptible to man-in-the-middle attacks.

javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found on Android 2.2

I am getting this issue when i replace my url with https...my url with http working fine but with https it's crashed,i search internet but not find any solution
You are probably using a CA for your certificate which is not known as trusted in the very old version of Android you are trying. More details might be given if you provide your URL.

Categories

Resources