Hi all,

We're trying to reuse an existing plain socket with TLS for FTPES
purposes:
SSLSocket socket = (SSLSocket) ssf.createSocket(_socket_, ip, port,
true);
and it hangs on:
socket.startHandshake();
See full code snippet below.

This code works fine on emulator (Android 2.2) but it fails on
NexusOne device.
Creating a TLS socket from scratch (without reuse) works perfect on
both.

What could be the problem?

Code snippet:
        plainSocket = _socket_; // plain socket works fine.
        initSslContext(); // No problem here
        SSLSocketFactory ssf = context.getSocketFactory();
        String ip = _socket_.getInetAddress().getHostAddress();
        int port = _socket_.getPort();
        SSLSocket socket = (SSLSocket) ssf.createSocket(_socket_, ip,
port, true);
        socket.setEnableSessionCreation(true);
        socket.setUseClientMode(true);
        if (protocols != null) socket.setEnabledProtocols(protocols);
        if (suites != null) socket.setEnabledCipherSuites(suites);
        socket.startHandshake(); // Hangs here

Cheers.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to