From d4cf848001ab703a452b059b8c17f2a4cb7a19ca Mon Sep 17 00:00:00 2001
From: Brett Parker <iDunno@sommitrealweird.co.uk>
Date: Sat, 23 Jul 2011 13:06:47 +0100
Subject: [PATCH] =?utf8?q?*=20Add=20https=20support=20(thanks=20to=20Andre?=
 =?utf8?q?=20Kl=C3=A4rner)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 rss2maildir.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/rss2maildir.py b/rss2maildir.py
index a1e8819..b4acdec 100755
--- a/rss2maildir.py
+++ b/rss2maildir.py
@@ -612,10 +612,17 @@ def open_url(method, url):
         (type, rest) = urllib.splittype(url)
         (host, path) = urllib.splithost(rest)
         (host, port) = urllib.splitport(host)
-        if port == None:
+        if type == "https":
+            if port == None:
+                port = 443
+        elif port == None:
             port = 80
         try:
-            conn = httplib.HTTPConnection("%s:%s" %(host, port))
+            conn = None
+            if type == "http":
+                conn = httplib.HTTPConnection("%s:%s" %(host, port))
+            else:
+                conn = httplib.HTTPSConnection("%s:%s" %(host, port))
             conn.request(method, path)
             response = conn.getresponse()
             if response.status in [301, 302, 303, 307]:
-- 
2.39.5