aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-05-01 00:17:55 +0200
committerMiklos Vajna <vmiklos@frugalware.org>2008-05-01 00:17:55 +0200
commit4c340e907d611c13bee56393aa782aa954f758fc (patch)
treeb0bb6eb2a913a7b0ae563c4c662102c81a591ab8
parent140ffc8762b385cd0caba57ba192faba46b21094 (diff)
modularize openssl code
- so that later we may use gnutls as well (or other ssl implementations)
-rw-r--r--skype/skyped.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/skype/skyped.py b/skype/skyped.py
index eab69a32..c9375596 100644
--- a/skype/skyped.py
+++ b/skype/skyped.py
@@ -31,7 +31,6 @@ import getopt
import Skype4Py
import sha
from ConfigParser import ConfigParser
-from OpenSSL import SSL
from traceback import print_exception
__version__ = "0.1.1"
@@ -75,10 +74,12 @@ def idle_handler(skype):
def server(host, port):
global options
+ from OpenSSL import SSL
ctx = SSL.Context(SSL.TLSv1_METHOD)
ctx.use_privatekey_file(options.config.sslkey)
ctx.use_certificate_file(options.config.sslcert)
sock = SSL.Connection(ctx, socket.socket())
+
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((host, port))
sock.listen(1)