New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[javax.net.ssl.SSLPeerUnverifiedException] ERROR: Cannot verify hostname: XXXX-XXXX.api.pushwoosh.com. Response = null #44
Comments
Which Android version do you have? |
@shaders thanks. running on android 4.4, and android 5, samsung galaxy s3, s4, s6 and lg , and asus. Searching about the problem , this is a problem with certificateCA in your main domain api.xxxxx If you try run the sample in your git , the problem is the same. When you add the code above, works fine, but im not receive any token registration.
|
I totally can't reproduce this. Can you open https://XXXX-XXXX.api.pushwoosh.com in your browser? |
@shaders nginx page showing a 403 |
Of course please replace XXXX-XXXX with your projectId |
@shaders I try again [now] , and after request , my browser redirect to pushwoosh login page. After login and call again url , redirected to project page. My android log - http://i.imgur.com/Xbloenx.png |
Sorry! My Bad! The correct URL should be: Where xxxx-xxxx is your app code. Try opening the page on the device in the browser to see if certificates will be ok there. |
Ok i try this url, the result is different. here , 3 images, requested url http:// url -> http://imgur.com/a/INXxn another one request url https:// url - > http://imgur.com/a/jjtMc My problem is , inside your SDK ( android in this case ) is the problem with certificates.
If you want i can connect with you using skype or other to you see in real time this problem. |
@shaders hi again, I try decompile your code from Jd-gui using your Pushwoosh.jar. I cant look exactly line on code, but apparently the problem is in this class. Looking the code, i can check one cp.pushwoosh request without https. and another ones. My error on android just show com.pushwoosh.internal.b.l.a(Uknownsource) , Thanks again |
We are not using self-signed certificates, you don't need to change SDK code to be able to connect to the API endpoints. Somehow your device doesn't like SSL chain and this is super weird. The screenshots you've made - are they from desktop? Could you open this links on a device on a device browser (Chrome on Android) instead? |
Works fine on chrome browser. url is ok.
|
What happens if you add to your AndroidManifest.xml <meta-data android:name="PushwooshUrl" android:value="https://cp.pushwoosh.com/json/1.3/"/> Make sure to uninstall app from the device before trying this to prevent any caching issues. |
ok, i will try. Im not uninstall other times. I will do that. In addition , looking on google, stackoverflow, and others places about.. I found on ignored exception in your sdk to Cordova, java too. The same expcetion, but in this code is ignored. |
What I'm trying to do now is try different endpoints to see what could be the problem. SDK may cache the endpoint between the launches that's why uninstall necessary. |
Ignoring SSLPeerUnverifiedException exception is dangerous as it puts your app vulnerable to MITM attack and compromises the integrity of the app's data. |
I understood. Because this im not add the code to force to bypass this domains. |
I just downgrade the version of your SDK to this jar. https://github.com/kaulsa88/PushWooshAndroidDemo (using jar this project works fine) The error desapear... .. |
But show a error in other point
|
Working registration and association device on version pushwoosh-4.1.0.jar More recent versions show SSL error too. |
Hi, Android SDK i tried add in our project here, but i receive this error on init in SDK .
Apparently this is a problem with https and your CACertificate in your domain.
XXXx-XXXX = Is my projectId i remove this here.
Full Stack :
javax.net.ssl.SSLPeerUnverifiedException: Cannot verify hostname: XXXX-XXXX.api.pushwoosh.com at android.net.SSLCertificateSocketFactory.verifyHostname(SSLCertificateSocketFactory.java:241) at android.net.SSLCertificateSocketFactory.createSocket(SSLCertificateSocketFactory.java:483) at com.android.okhttp.Connection.upgradeToTls(Connection.java:131) at com.android.okhttp.Connection.connect(Connection.java:107) at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294) at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255) at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206) at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345) at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:89) at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:197) at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:254) at com.pushwoosh.internal.b.l.a(Unknown Source) at com.pushwoosh.internal.b.l.a(Unknown Source) at com.pushwoosh.internal.b.l$1.run(Unknown Source)
Adding this code in my main activity to ignore all SSL problems certificates and others, your SDK works.
try { HttpsURLConnection.setDefaultHostnameVerifier(new NullHostNameVerifier()); SSLContext context = SSLContext.getInstance("TLS"); context.init(null, new X509TrustManager[]{new NullX509TrustManager()}, new SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory()); }catch (Exception e){ e.printStackTrace(); }
mention about the same problem.
http://stackoverflow.com/questions/31917988/okhttp-javax-net-ssl-sslpeerunverifiedexception-hostname-domain-com-not-verifie
The text was updated successfully, but these errors were encountered: