HTTPS with/without CA keys

29 views
Skip to first unread message

hoav...@gmail.com

unread,
Feb 26, 2014, 1:05:53 PM2/26/14
to codenameone...@googlegroups.com
I want to do connection to url host in https, in 2 ways: accept all without verify SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER (no need key store), and another case with key store BKS.
Does ConnectionRequest in CN1 support it? How to write code? 
In Android, I send data to host by HTTPPost with header, get data by HTTPResponse. I dont know what functions similiar in CN1.

Please help me with code.
Thanks.

hoav...@gmail.com

unread,
Feb 26, 2014, 1:11:00 PM2/26/14
to codenameone...@googlegroups.com, hoav...@gmail.com
And how to use AsynTask in CN1 too?

Shai Almog

unread,
Feb 26, 2014, 1:51:15 PM2/26/14
to codenameone...@googlegroups.com, hoav...@gmail.com
We don't support it. You might be able to implement this on top of our socket suppot but we don't have this built in.
NetworkManager and ConnectionRequest allow you to do networking, they automatically run in their own thread so you don't need async task.
You can use invokeAndBlock, background tasks and regular threads. The former two are available in Display and explained in the EDT section of the developer guide.

hoav...@gmail.com

unread,
Feb 26, 2014, 10:10:31 PM2/26/14
to codenameone...@googlegroups.com, hoav...@gmail.com
Hi, sorry, I am new, I dont understand: "implement this on top of our socket support".
You mean native code for each OS, or implement a class from Java? Can I use java library?
Do you have an example of any implement code (of any class), let me understand about it?  

Thanks.
PS: I think today, we almost use HTTPS, hope in next version, you will implement it into ConnectionRequest class.

Shai Almog

unread,
Feb 27, 2014, 2:03:59 AM2/27/14
to codenameone...@googlegroups.com, hoav...@gmail.com
We have a socket API.
ConnectionRequest supports HTTPS but it doesn't support manipulating the SSL layer which is native in the various platforms and often not fully accessible.

You can use native code to use external jars but you would need to write it for every platform: http://www.codenameone.com/3/post/2013/07/jaring-and-libraries.html
Reply all
Reply to author
Forward
0 new messages