Hi,

It looks like SSLCertificateSocketFactory.setHostname is broken on
Marshmallow, Lollipop.

public void sslTest() {
    Thread thread = new Thread(new Runnable() {
        public void run() {
            SSLCertificateSocketFactory factory =
                    (SSLCertificateSocketFactory)
SSLCertificateSocketFactory.getDefault(0);
            try {
                Socket sslSocket = factory.createSocket("www.google.com", 443);
                factory.setHostname(sslSocket, "www.google.com");
                OutputStream out = sslSocket.getOutputStream();
                out.write("GET / HTTP/1.1".getBytes());
            } catch (Exception e) {
                Log.d(TAG, "Exception in ssl: " + e);
            }
        }
    });
    thread.start();
}

Wireshark shows there is no SNI value in ClientHello message.

Any idea?

Thanks,

/Kaiduan

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to