From c7e57ae16ea9024ec55f401a18158c09bc45a1a3 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Fri, 17 Apr 2015 15:17:59 +0200 Subject: Last polishing before v2.0 --- beinc_config_sample.json | 5 ++--- beinc_config_sample.json.readme | 6 +++--- beinc_server.py | 4 ++-- beinc_weechat.py | 14 +++++++++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/beinc_config_sample.json b/beinc_config_sample.json index c61a033..046e3fa 100644 --- a/beinc_config_sample.json +++ b/beinc_config_sample.json @@ -4,14 +4,13 @@ "ssl_private_key": "key.pem", "ssl_certificate": "cert.crt", "ssl_acceptable_ciphers": "auto", - "ssl_method": "auto", - "daemonize": 1 + "ssl_version": "auto" }, "instances": [ { "name": "test", "password": "changeme", - "osd_system": "pynotify", + "osd_system": "pyosd", "osd_timeout": 5, "pyosd_font": "", "pyosd_vertical_offset": 120, diff --git a/beinc_config_sample.json.readme b/beinc_config_sample.json.readme index 67cc5c2..9c5aecc 100644 --- a/beinc_config_sample.json.readme +++ b/beinc_config_sample.json.readme @@ -26,7 +26,7 @@ documentation to better illustrate the comments. # A list of allowed ciphers in the format of 'openssl ciphers' # "auto" - use the Twisted / OpenSSL defaults - "ssl_acceptable_ciphers": "auto", # default: "auto" + "ssl_ciphers": "auto", # default: "auto" # Encryption method for the BEINC server # Possible values: @@ -35,7 +35,7 @@ documentation to better illustrate the comments. # "TLSv1" - TLSv1.0 # "TLSv1_1" - TLSv1.1 # "TLSv1_2" - TLSv1.2 (most secure, but requires OpenSSL >= 1.0.1e) - "ssl_method": "auto", # default: "auto" + "ssl_version": "auto", # default: "auto" }, @@ -119,7 +119,7 @@ documentation to better illustrate the comments. # A list of preferred ciphers for this target # Default: "" (use the OpenSSL default ciphers) - "ciphers": "ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384", + "ssl_ciphers": "ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384", # Don't check whether the target's hostname matches the server's # certificate. (Only Python >= 2.7.9) diff --git a/beinc_server.py b/beinc_server.py index cf4f7c7..53f12c5 100755 --- a/beinc_server.py +++ b/beinc_server.py @@ -361,9 +361,9 @@ def main(): ssl_private_key = config_dict['server']['general'].get( 'ssl_private_key') ssl_method_str = config_dict['server']['general'].get( - 'ssl_method', 'auto') + 'ssl_version', 'auto') ssl_acceptable_ciphers_str = config_dict['server']['general'].get( - 'ssl_acceptable_ciphers', 'auto') + 'ssl_ciphers', 'auto') beinc_server = XMLRPCNotifyServer(config_dict) if ssl_certificate and ssl_private_key: # SSL connection diff --git a/beinc_weechat.py b/beinc_weechat.py index c52396d..5082c1d 100644 --- a/beinc_weechat.py +++ b/beinc_weechat.py @@ -154,7 +154,7 @@ class WeechatTarget(object): self.__debug = bool(target_dict.get('debug', False)) self.__enabled = bool(target_dict.get('enabled', True)) self.__socket_timeout = int(target_dict.get('socket_timeout', 3)) - self.__ciphers = target_dict.get('ciphers', '') + self.__ssl_ciphers = target_dict.get('ssl_ciphers', '') self.__disable_hostname_check = bool( target_dict.get('disable-hostname-check', False)) self.__ssl_version = target_dict.get('ssl_version', 'auto') @@ -333,6 +333,10 @@ class WeechatTarget(object): """ if self.__connection: return True + if self.__debug: + beinc_prnt( + 'BEINC DEBUG: (Re)Establishing connection to: {0}'.format( + self.__url)) try: ssl_version = BEINC_SSL_METHODS.get(self.__ssl_version, ssl.PROTOCOL_SSLv23) @@ -346,8 +350,8 @@ class WeechatTarget(object): self.__cert_file)) context.check_hostname = bool( not self.__disable_hostname_check) - if self.__ciphers: - context.set_ciphers(self.__ciphers) + if self.__ssl_ciphers: + context.set_ciphers(self.__ssl_ciphers) transport = xmlrpclib.SafeTransport(context=context) else: # Python < 2.7.9 @@ -357,8 +361,8 @@ class WeechatTarget(object): ssl_options['ca_certs'] = os.path.expanduser( self.__cert_file) ssl_options['cert_reqs'] = ssl.CERT_REQUIRED - if self.__ciphers: - ssl_options['ciphers'] = self.__ciphers + if self.__ssl_ciphers: + ssl_options['ciphers'] = self.__ssl_ciphers transport = BEINCCustomSafeTransport( custom_ssl_options=ssl_options) self.__connection = xmlrpclib.ServerProxy(self.__url, -- cgit v1.3