Android SSLPeerUnVerfiedException - android

am working https webservice and the certificate is self signed, so import this into my project and create bks file for overriding the error , but still i get SSLPeerUnverfiedException . I had also check with following so question HttpGet with HTTPS : SSLPeerUnverifiedException ,this also not help me

Have you tried this approach by bob lee: http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html
It solved my issue

Related

Dialogflow error Authorization failed. Please check your access keys

I have test for dialogflow with android. It was work well a few days ago.
but Nowdays It is occured
Caused by: ai.api.AIServiceException: Authorization failed. Please check your access keys.
at ai.api.AIDataService.request(AIDataService.java:205)
at ai.api.AIDataService.request(AIDataService.java:148)
at ai.api.AIDataService.request(AIDataService.java:124)
I didn't chagne anythings about clientkey and I was check
clientKey Android or Dialogflow Page. It is same
Why it occur?
does Dialogflow add SHA1 key? something like certificate?
I had the same problem.
My solution:
1. Export your Agent that doesn't work (zip file)
2. Create a new Agent and import the Agent which you just exported.

Volley library and HTTPS requests

I tried to look for some answers for me here, but I just fail to find anything that solves my problem.
In project I am working on we are going to change our domain. Change is bit tricky - we have to also change connection from HTTP to HTTPS. I've received .crt key (let's say, example.tech.crt - will change all of company name to "example"). After few hours of constant failures I decided to write here.
First of all, I tried using this tutorial http://ogrelab.ikratko.com/using-android-volley-with-self-signed-certificate/ - and it didn't work (I don't even mean that I had to use deprecated Apache libs because of API23). In case this is needed, this is how I created BKS file:
keytool -importcert -v -trustcacerts -file "example.tech.crt" -alias example_tech
-keystore "example_tech.bks" -provider org.bouncycastle.jce.provider.BouncyCastleProvider
-providerpath "bcprov-jdk16-146.jar" -storetype BKS
Then, I tried this approach Does Android Volley support SSL? - the one from best answer (with ignoring domain name check). I still tried to use BKS file - I've got some exceptions about casting errors, so I changed line:
CertificateFactory cf = CertificateFactory.getInstance("X.509");
to
CertificateFactory cf = CertificateFactory.getInstance("X.509", "BC");
as suggested somewhere - error still persisted. I tried to use .crt file instead of BKS - I still fail.
Every single time I get same error:
javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException:
SSL handshake aborted: ssl=0x650f83a0: Failure in SSL library, usually a protocol error
error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol
(external/openssl/ssl/s23_clnt.c:714 0x5fda0d74:0x00000000)
I tried to do pretty much same requests using Postman and they work on same address without any problem, so this is not server problem. I tried to use various domains - example.tech, www.example.tech, example.tech:80 and so on (always with https of course).
Below is example curl-like request (of course censored):
curl request: curl -X "POST"
-D "grant_type=password&password=[passwordHere]&username=[emailHere]&"
-H 'Authorization: Basic [tokenHere]
"https://example.tech/oauth/token"
I fail to see what's wrong with my code and I'd be really happy to see what I am doing wrong in here. If there's any more code needed, feel free to ask for it (but 99% of it is like in second link, only with really small changes).
Consider this topic as example of poor comunication. After hours of trying to make this work we made to work:
we are NOT using selfsigned certificates, so adding key to application is terrible idea (since they change each 3 months)
unsupported protocol exception came from older Android APIs (<20 or <21), which are supported in this application. From I do understand (considering my poor knowledge about SSL connections) our site uses TLS, but older Android systems (pre-Lollipop I guess) have this turned off by default. Proper way of fixing this was creating custom TLSSocketFactory and using it in HurlStack used to initialize RequestQueue. After that exception disappeared.

MobileFirst Adapter - FWLSE0152E: Unable to find certificate chain with alias: 'mydomain.com' for HTTPS protocol

I have followed the steps as mentioned in below url :
Configuring SSL between MobileFirst adapters & back-end servers by using self-signed certificates.
After performing above steps, I am able to see the certificate in key store with correct alias name 'mydomain.com'. However, when I try to invoke the procedure which has defined in HTTP adapter to make a call to back end server using HTTPS, below exception has thrown in worklight server console.
FWLSE0152E: Unable to find certificate chain with alias: 'mydomain.com'
Could you please provide any suggestions which would help us to resolve this issue.
Looks like the CN of your backend server is not equals to backend domain name that you defined in the adapter xml file.
If the CN=mydomain.com try to export public certificate from backend keystore and import it into adapter's keystore using open ssl library.

Getting error of parsing the package during updating my new version of apk

Android Experts, I have installed signed apk (version 1.6) and on my server I've uploaded apk( version 1.7). Now I am facing problem during Update my apk from server.. I also got Dialog box for Updating but at the end I am getting error as
"Parser Error, There is a problem parsing the package." . I found some solution from some links but it doesn't work.
I am waiting for your suggestions, any ideas and your solution.
Thank U.!
You can check following things in your code
1. Already installed Apk name and updated apk name should be same.
2. Both Android Manifest contain same android:minSdkVersion value.
Yeppiee... finally I got my solution.. Actually I put wrong file path during Updating code on "onPostExecute".. So thts why I could not Update my apk and was getting "Parser Error, There is a problem parsing the package"
And One more thing If U r update your apk from server U must have following things:
- installed Apk name and updated apk name should be same.
- Both Android Manifest contain same android:minSdkVersion value.(Here My Android Tablet 4.0.3 and I put minSdkVersion:14)
- And Last If U r using asp.net U must Add .APK MIME Type to IIS - Microsoft Server Support. In IIS there needs to be a MIME type added to allow IIS to support the .APK file type.
Check this link

UnknownHostexception using apache commons

I am currently working with apache commons in my Project to gain access to my FTP Server.
Uploading a file is no problem at all, but If I want to download a file, I get an UnknownHost Exception what is strange because it is the same ftp server.
client.connect("ftp.liamissimo.li.ohost.de",21);
client.login("XXX", "XXX");
client.enterLocalPassiveMode();
This code works like this for uploading, but if I use it to download I got an UnknownHost exception.
I had a problem like this and I got it to work by using the IP of the hostname instead of the actual hostname...
check permissions in manifest file.
uses-permission android:name="android.permission.INTERNET"/>

Categories

Resources