[Chandler-dev] Patch for https support in Chandler-FeedsPlugin

Jonathan 'Arrouan' ROUZAUD-CORNABAS arrouan at octogone.biz
Wed Dec 19 09:26:05 PST 2007


Diff file between the modified version and the original 0.7.3 
channels.py file.
-------------- next part --------------
--- chandler/projects/Chandler-FeedsPlugin/feeds/channels.py	2007-12-07 00:17:22.000000000 +0100
+++ ../chandler/projects/Chandler-FeedsPlugin/feeds/channels.py	2007-12-19 17:27:41.000000000 +0100
@@ -139,7 +139,6 @@
         else:
             client.HTTPClientFactory.noPage(self, reason)
 
-
 class FeedChannel(pim.ListCollection):
     """
     This class implements a feed channel collection that is visualized
@@ -154,6 +153,7 @@
     date = schema.One(schema.DateTime)
     url = schema.One(schema.URL)
     etag = schema.One(schema.Text)
+    ContextFactory = None
     lastModified = schema.One(schema.DateTime)
     copyright = schema.One(schema.Text)
     language = schema.One(schema.Text)
@@ -199,7 +199,16 @@
         path = str(path)
         factory = ConditionalHTTPClientFactory(url=url,
             lastModified=lastModified, etag=etag, timeout=60)
-        reactor.connectTCP(host, port, factory)
+        
+	
+	if scheme == 'https':
+        	logger.info("HTTPS RSS Feed detected host: %s" % host)
+		logger.info("HTTPS RSS Feed detected port: %s" % port)
+		from twisted.internet import ssl
+        	contextFactory = ssl.ClientContextFactory()
+        	reactor.connectSSL(host, port, factory, contextFactory)
+        else:
+		reactor.connectTCP(host, port, factory)
 
         return factory.deferred
     


More information about the chandler-dev mailing list