Skip to content

Allow settings TLS protocols in WebSocket options #374

Open
@0xAliHn

Description

@0xAliHn

I am using android API 19 for my project. But as mentioned in the android developer https://developer.android.com/reference/javax/net/ssl/SSLSocket.html documentation TLSv1.2 protocols is not enabled by default in android API <20.

As I am using API 19 and we must need to enable TLSv1.2 for successful handshaking.
Currently getting below error:
connection close, Notification: 5 reason: WebSockets internal error (javax.net.ssl.SSLException: Read error: ssl=0xb7747000: I/O error during system call, Software caused connection abort)

This can be handled using below implementation in CustomSocketFactory/SocketFactory:

private Socket enableTLSOnSocket(Socket socket) {
        if(socket != null && (socket instanceof SSLSocket)) {
            ((SSLSocket)socket).setEnabledProtocols(new String[] {"TLSv1.1", "TLSv1.2"});
        }
        return socket;
    }

Would you please help us to implement this in your autobahn java library or any API exposure will be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions