Android Question httpclient initialize accept all not working

Nickelgrass

Active Member
Licensed User
Longtime User
Hi,
I am using the PushExample to register the device on a webserver (HTTPS). I added the httputils2 as modules, unchecked the library and changed the hc.initialize to hc.initializeacceptall. So it should work.
But I still get the same error: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate . What is going on here? What could still be wrong?
Thanks!
 

Reviewnow

Active Member
Licensed User
Longtime User
I am assuming that you connecting to a web service, the web service namespace has to equal your https assignment

Example asmx webservice
<WebService(Namespace:=https://yourdomain.com/yourservice)> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

this is assuming your are connecting windows webservice
 
Upvote 0

Nickelgrass

Active Member
Licensed User
Longtime User
Hi, thaks for the replies.
I dont exactly know what you mean with namespace. I have a webserver and it has a htaccess to redirect all incoming to https. On this server there is a php skript to receive the registration and one to send a push notification. I have included them in the zip file.
I assume the SenderID in the B4A code is the 12 digit google project id and the api key in the push.send.php is the very long google api key.
Thanks!
 

Attachments

  • push.zip
    12.4 KB · Views: 290
Last edited:
Upvote 0

Nickelgrass

Active Member
Licensed User
Longtime User
Thanks for the reply! I am aware that the hc.initialize is in the wrong place. It was just to test that I put it there, I had it in the right place usually.
This is the full error message from the log: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate . No more.
The server is my own private webpage hosted by a normal commercial provider where I put the php scripts. I do not have a baught SLL certificate. Could that be the problem?

The actual GCM registration works, I get a code and can send a notification if I manually update the id. Just that one request to the push.reg.php fails.
 
Last edited:
Upvote 0

Nickelgrass

Active Member
Licensed User
Longtime User
I have done how you suggested. I rewrote it all to use the httpclient directly but I still get the same error and no other information (statuscode -1) javax.net.ssl.SSLPeerUnverifiedException: No peer certificate .
I altered my htaccess and disabled the https rewriteengine and then it worked. So I suppose there is something wrong with the combination of my rewreiteengine and the httpclient. My htacces looks like this:
B4X:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Nothing fancy.
Any suggestions what it could be? I tryed the links that I try to get with the initializeget and it works in the browser. My PHP script does not log any activity from the App.
So the httpclient doesnt like something about the rewrite.
 
Last edited:
Upvote 0

Nickelgrass

Active Member
Licensed User
Longtime User
Ok, I modified the code a little to only do a simple get to the server php without all the google stuff. Here is the code and the resulted log. It shows some W/System.err( nnn). Perhaps it may put some light in the case.
Thanks a lot!
 

Attachments

  • push.zip
    11.7 KB · Views: 254
Upvote 0

Nickelgrass

Active Member
Licensed User
Longtime User
Does anyone know if this will be available any time soon? I would desperatly need to access HTTPS on a SNI webserver.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Does anyone know if this will be available any time soon?
You need to ask google whether they put this into his APIs; not Erel.
Erel just can only use what google put into their APIs.
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Hi
I am having same issue (I think)
I moved from http to https in my project and web site
and I am getting this error:
Error: javax.net.ssl.SSLPeerUnverifiedException: No peer certificate

I am using httputils2 library
Job.PostString("http://www.something.com/Main.php", Query)

I checked and the web site is using SNI
We use SNI (Server Name Indication) which enables multiple websites to run on the same IP number. SNI is not supported by Internet Explorer on Windows XP meaning that the (very low number of) users running Internet Explorer on Windows XP will not be able to take advantage of SSL on your website.

anything I can do? since my issue is that if I put sniffer I can see in clear text my request and response to the database and this is not good...
 
Upvote 0
Top