Complete.Org: Mailing Lists: Archives: offlineimap: May 2009:
[PATCH] fix ssl deprecation warning
Home

[PATCH] fix ssl deprecation warning

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: [PATCH] fix ssl deprecation warning
From: Christoph Höger <choeger@xxxxxxxxxxxxxxx>
Date: Thu, 14 May 2009 19:33:17 +0200

honestly I do not know, If that works with python < 2.6 but I guess it should.
Signed-off-by: Christoph Höger <choeger@xxxxxxxxxxxxxxx>
---
 offlineimap/imaplibutil.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/offlineimap/imaplibutil.py b/offlineimap/imaplibutil.py
index 27ed1fa..e7f5a24 100644
--- a/offlineimap/imaplibutil.py
+++ b/offlineimap/imaplibutil.py
@@ -19,6 +19,7 @@
 import re, string, types, binascii, socket, time, random, subprocess, sys, os
 from offlineimap.ui import UIBase
 from imaplib import *
+import ssl
 
 # Import the symbols we need that aren't exported by default
 from imaplib import IMAP4_PORT, IMAP4_SSL_PORT, InternalDate, Mon2num
@@ -166,8 +167,8 @@ def new_open_ssl(self, host = '', port = IMAP4_SSL_PORT):
         if last_error != 0:
             # FIXME
             raise socket.error(last_error)
-        self.sslobj = socket.ssl(self.sock, self.keyfile, self.certfile)
-        self.sslobj = sslwrapper(self.sslobj)
+        self.sslobj = sslwrapper(ssl.wrap_socket(self.sock, self.keyfile,
+        self.certfile))
 
 mustquote = re.compile(r"[^\w!#$%&'+,.:;<=>?^`|~-]")
 
-- 
1.6.2.2

-- Attached file included as plaintext by Ecartis --
-- File: signature.asc
-- Desc: Dies ist ein digital signierter Nachrichtenteil

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkoMVdsACgkQhMBO4cVSGS+xmwCfdzW7mv1H6m7GngbLoTUGsU09
KD0Ani61b2Fsb6+cRd5uiu0iiblNfbXZ
=FDOj
-----END PGP SIGNATURE-----




[Prev in Thread] Current Thread [Next in Thread]