I am trying to connect with secure websocket connection wss:// in android using org.java_websocket.client.WebSocketClient API, but unable to connect with https. However it is working fine with ws://.. Here is my code.
private void connect(String websocketEndPointUrl) throws Exception {
    URI uri;
    try {
        websocketEndPointUrl="wss://echo.websocket.org:443";
        Log.i(TAG, " WSURL: " + websocketEndPointUrl);
        uri = new URI(websocketEndPointUrl);
    } catch (URISyntaxException e) {
        Log.e(TAG, e.getMessage());
        return;
    }
    mWebSocketClient = new WebSocketClient(uri,new Draft_17()) {
        @Override
        public void onOpen(ServerHandshake serverHandshake) {
            Log.i("Websocket", "Opened");
         }
        @Override
        public void onMessage(String s) {
            //final String message =s;
         }
        @Override
        public void onClose(int i, String s, boolean b) {
            Log.i("Websocket", "Closed " + s);
         }
        @Override
        public void onError(Exception e) {
            Log.i("Websocket", "Error " + e.getMessage());
         }
    };
    mWebSocketClient.connect();
}
i am using online test websocket url: ws://echo.websocket.org (port 80) // working with that wss://echo.websocket.org (port 443) As per my observation there is no need of certificate required in my code. Can anyone suggest me what is a reason and how i can fix this.
 
    