Changeset b0d40f5
- Timestamp:
- 2008-04-30T23:57:49Z (17 years ago)
- Branches:
- master
- Children:
- e3d0b10
- Parents:
- 4c340e9
- Location:
- skype
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
skype/README
r4c340e9 rb0d40f5 35 35 * PyGObject >= 2.8.0. Older versions are part of PyGTK. (And you don't want to 36 36 install GTK for nothing, right?) 37 * pyopenssl or python-gnutls. 37 38 38 39 `bitlbee-skype` has been tested under Linux and Mac OS X. Skype and Skype4py is … … 112 113 NOTE: Maybe you want to adjust the permissions in the `/usr/local/etc/skyped` 113 114 dir. For example make it readable by just your user. 115 116 - If both pyopenssl and python-gnutls are available, then python-gnutls 117 will be used. This behaviour can be overwritten by: 118 119 ---- 120 $ export SKYPED_NO_GNUTLS=1 121 ---- 114 122 115 123 - Start `skyped` (the tcp server): -
skype/skyped.py
r4c340e9 rb0d40f5 74 74 def server(host, port): 75 75 global options 76 77 from OpenSSL import SSL 78 ctx = SSL.Context(SSL.TLSv1_METHOD) 79 ctx.use_privatekey_file(options.config.sslkey) 80 ctx.use_certificate_file(options.config.sslcert) 81 sock = SSL.Connection(ctx, socket.socket()) 82 76 try: 77 if "SKYPED_NO_GNUTLS" in os.environ.keys(): 78 dprint("Warning, using OpenSSL instead of gnutls as requested (not recommended).") 79 raise ImportError 80 from gnutls import crypto, connection 81 cert = crypto.X509Certificate(open(options.config.sslcert).read()) 82 key = crypto.X509PrivateKey(open(options.config.sslkey).read()) 83 cred = connection.X509Credentials(cert, key) 84 sock = connection.ServerSessionFactory(socket.socket(), cred) 85 except ImportError: 86 from OpenSSL import SSL 87 ctx = SSL.Context(SSL.TLSv1_METHOD) 88 ctx.use_privatekey_file(options.config.sslkey) 89 ctx.use_certificate_file(options.config.sslcert) 90 sock = SSL.Connection(ctx, socket.socket()) 83 91 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) 84 92 sock.bind((host, port)) … … 89 97 global options 90 98 options.conn, addr = sock.accept() 99 if hasattr(options.conn, 'handshake'): 100 options.conn.handshake() 91 101 ret = 0 92 102 line = options.conn.recv(1024)
Note: See TracChangeset
for help on using the changeset viewer.