From d908a3a456653bbf0ba160b163bae1689838a063 Mon Sep 17 00:00:00 2001 From: HelloZeroNet Date: Thu, 18 Jun 2015 20:31:33 +0200 Subject: [PATCH] rev245, Fix for gevent1.0.2 ssl, Disable asnyc js load (its slower on my browser) --- src/Config.py | 2 +- src/Crypt/CryptConnection.py | 13 +++++++++---- src/Ui/template/wrapper.html | 2 +- src/main.py | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Config.py b/src/Config.py index c3398a64..a3255e30 100644 --- a/src/Config.py +++ b/src/Config.py @@ -4,7 +4,7 @@ import ConfigParser class Config(object): def __init__(self): self.version = "0.3.1" - self.rev = 242 + self.rev = 245 self.parser = self.createArguments() argv = sys.argv[:] # Copy command line arguments argv = self.parseConfig(argv) # Add arguments from config file diff --git a/src/Crypt/CryptConnection.py b/src/Crypt/CryptConnection.py index 9dd33741..764739ce 100644 --- a/src/Crypt/CryptConnection.py +++ b/src/Crypt/CryptConnection.py @@ -1,8 +1,13 @@ -import sys, logging, os +import sys +import logging +import os +import ssl + from Config import config import gevent from util import SslPatch + class CryptConnectionManager: def __init__(self): # OpenSSL params @@ -30,9 +35,9 @@ class CryptConnectionManager: if crypt == "tls-rsa": ciphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:AES128-GCM-SHA256:AES128-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DSS:!DES:!RC4:!3DES:!MD5:!PSK" if server: - return gevent.ssl.wrap_socket(sock, server_side=server, keyfile='%s/key-rsa.pem' % config.data_dir, certfile='%s/cert-rsa.pem' % config.data_dir, ciphers=ciphers) + return ssl.wrap_socket(sock, server_side=server, keyfile='%s/key-rsa.pem' % config.data_dir, certfile='%s/cert-rsa.pem' % config.data_dir, ciphers=ciphers) else: - return gevent.ssl.wrap_socket(sock, ciphers=ciphers) + return ssl.wrap_socket(sock, ciphers=ciphers) else: return sock @@ -43,7 +48,7 @@ class CryptConnectionManager: if os.path.isfile(file_path): os.unlink(file_path) - # Loand and create cert files is necessary + # Load and create cert files is necessary def loadCerts(self): if config.disable_encryption: return False diff --git a/src/Ui/template/wrapper.html b/src/Ui/template/wrapper.html index dfa00aad..dcbc5e31 100644 --- a/src/Ui/template/wrapper.html +++ b/src/Ui/template/wrapper.html @@ -57,7 +57,7 @@ permissions = {permissions} show_loadingscreen = {show_loadingscreen} server_url = '{server_url}' - + diff --git a/src/main.py b/src/main.py index 1f158669..b1580662 100644 --- a/src/main.py +++ b/src/main.py @@ -54,7 +54,7 @@ if config.debug: else: console_log.setLevel(logging.INFO) # Display only important info to console -monkey.patch_all(thread=False, ssl=False) # Make time, socket gevent compatible. Not thread: pyfilesystem and system tray icon not compatible, Not ssl: broken in 2.7.9 +monkey.patch_all(thread=False) # Make time, socket gevent compatible. Not thread: pyfilesystem and system tray icon not compatible