use of com.iiordanov.bVNC.exceptions.AnonCipherUnsupportedException in project remote-desktop-clients by iiordanov.
the class RemoteCanvas method startVncConnection.
/**
* Starts a VNC connection using the TightVNC backend.
*
* @throws Exception
*/
private void startVncConnection() throws Exception {
Log.i(TAG, "Connecting to: " + connection.getAddress() + ", port: " + connection.getPort());
String address = getAddress();
int vncPort = getPort(connection.getPort());
boolean sslTunneled = connection.getConnectionType() == Constants.CONN_TYPE_STUNNEL;
try {
rfb = new RfbProto(decoder, this, address, vncPort, connection.getPrefEncoding(), connection.getViewOnly(), connection.getUseLocalCursor(), sslTunneled, connection.getIdHashAlgorithm(), connection.getIdHash(), connection.getSshHostKey());
Log.v(TAG, "Connected to server: " + address + " at port: " + vncPort);
rfb.initializeAndAuthenticate(connection.getUserName(), connection.getPassword(), connection.getUseRepeater(), connection.getRepeaterId(), connection.getConnectionType(), connection.getSshHostKey());
} catch (AnonCipherUnsupportedException e) {
showFatalMessageAndQuit(getContext().getString(R.string.error_anon_dh_unsupported));
} catch (Exception e) {
e.printStackTrace();
throw new Exception(getContext().getString(R.string.error_vnc_unable_to_connect) + Utils.messageAndStackTraceAsString(e));
}
rfbconn = rfb;
pointer = new RemoteVncPointer(rfbconn, RemoteCanvas.this, handler);
boolean rAltAsIsoL3Shift = Utils.querySharedPreferenceBoolean(this.getContext(), Constants.rAltAsIsoL3ShiftTag);
keyboard = new RemoteVncKeyboard(rfbconn, RemoteCanvas.this, handler, rAltAsIsoL3Shift);
rfb.writeClientInit();
rfb.readServerInit();
// Is custom resolution enabled?
if (connection.getRdpResType() != Constants.VNC_GEOM_SELECT_DISABLED) {
waitUntilInflated();
rfb.setPreferredFramebufferSize(getVncRemoteWidth(getWidth(), getHeight()), getVncRemoteHeight(getWidth(), getHeight()));
}
initializeBitmap(displayWidth, displayHeight);
decoder.setPixelFormat(rfb);
handler.post(new Runnable() {
public void run() {
pd.setMessage(getContext().getString(R.string.info_progress_dialog_downloading));
}
});
sendUnixAuth();
if (connection.getUseLocalCursor())
initializeSoftCursor();
handler.post(drawableSetter);
handler.post(setModes);
// Hide progress dialog
if (pd.isShowing())
pd.dismiss();
rfb.processProtocol();
}
Aggregations