Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* add ssl to the list of connection options
* handle it mostly like tcp
* we must now pass the config to "connect_to" (change in API)

git-svn-id: https://xpra.org/svn/Xpra/trunk@13294 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Aug 10, 2016
1 parent 3664357 commit 4b0d87a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/xpra/client/gtk_base/client_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,16 @@ def get_launcher_validation(self):
crypto_backend_init()
#TODO: since "mode" is not part of global options
#this validation should be injected from the launcher instead
MODES = ["tcp", "ssh"]
MODES = ["tcp"]
try:
import ssl
assert ssl
MODES.append("ssl")
except:
pass
if "AES" in ENCRYPTION_CIPHERS:
MODES = ["tcp", "tcp + aes", "ssh"]
MODES.append("tcp + aes")
MODES.append("ssh")
def validate_in_list(x, options):
if x in options:
return None
Expand Down Expand Up @@ -532,10 +539,10 @@ def connect_builtin(self):
params["display"] = ":%s" % self.config.port
params["display_name"] = "unix-domain:%s" % self.config.port
else:
#tcp:
assert self.config.mode in ("tcp", "ssl"), "invalid / unsupported mode %s" % self.config.mode
params["host"] = self.config.host
params["port"] = int(self.config.port)
params["display_name"] = "tcp:%s:%s" % (self.config.host, self.config.port)
params["display_name"] = "%s:%s:%s" % (self.config.mode, self.config.host, self.config.port)

#print("connect_to(%s)" % params)
#UGLY warning: the username may have been updated during display parsing,
Expand All @@ -555,7 +562,7 @@ def do_connect_builtin(self, params):
self.set_info_text("Connecting.")
self.set_sensitive(False)
try:
conn = connect_to(params, self.set_info_text, ssh_fail_cb=self.ssh_failed)
conn = connect_to(params, opts=self.config, debug_cb=self.set_info_text, ssh_fail_cb=self.ssh_failed)
except Exception as e:
log.error("failed to connect", exc_info=True)
self.handle_exception(e)
Expand Down

0 comments on commit 4b0d87a

Please sign in to comment.