简体   繁体   中英

SSL connection between two Android devices

I am new to SSL. I need to implement SSL connection between two Android devices via TCP. Is there any example how to do it? How can I create SSLServerSocket?

I tried to set property for default keystore, for using SSLServerSocket

System.setProperty("javax.net.ssl.keyStore", "my_keystore");
System.setProperty("javax.net.ssl.keyStorePassword", "password");

this doesn't help.

I'm able to create SSLServerSocket, but on accept() it fails with following exception: " SSLException: Could not find any key store entries to support the enabled cipher suites " Also I use certificate of a proper type on Android: BKS

Thanks in advance.

This is not different than using SSL sockets on any platform, refer to the JSSE reference. The only thing to watch out is that you need to have the phones on the same network (if local), and your carrier might be filtering/blocking inbound connections if on 3G, etc. Also keep in mind that mobile devices can change their IP when re-connecting, etc., so a fixed IP might not work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM