Revision
3642
Author
darla@apple.com
Date
2009-02-05 12:36:21 -0800 (Thu, 05 Feb 2009)

Log Message

<rdar://6541865> RedirectHTTPToHTTPS is redirecting to the wrong HTTPS port

Modified Paths

Diff

Modified: CalendarServer/trunk/calendarserver/tap/caldav.py (3641 => 3642)


--- CalendarServer/trunk/calendarserver/tap/caldav.py	2009-02-05 15:18:19 UTC (rev 3641)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py	2009-02-05 20:36:21 UTC (rev 3642)
@@ -497,7 +497,7 @@
         if config.Scheduling.iSchedule.Enabled:
             self.log_info("Setting up iSchedule inbox resource: %r"
                           % (self.iScheduleResourceClass,))
-    
+
             ischedule = self.iScheduleResourceClass(
                 NotFilePath(isfile=True),
                 root,
@@ -510,7 +510,7 @@
         if config.Scheduling.iMIP.Enabled:
             self.log_info("Setting up iMIP inbox resource: %r"
                           % (self.imipResourceClass,))
-    
+
             imipInbox = self.imipResourceClass(root)
             root.putChild("inbox", imipInbox)
 
@@ -693,7 +693,12 @@
 
                 if config.RedirectHTTPToHTTPS and successfulSSLPorts:
                     # Redirect non-SSL ports to the first ssl port
-                    RedirectRequest.port = successfulSSLPorts[0]
+                    # Or for slave processes, use the main SSL port (since the slave's ports
+                    # aren't accessible to clients).  <rdar://6541865>
+                    if config.ProcessType == "Slave":
+                        RedirectRequest.port = config.SSLPort
+                    else:
+                        RedirectRequest.port = successfulSSLPorts[0]
                     self.log_info("Redirecting %s:%s to %s" %
                         (bindAddress, port, RedirectRequest.port))
                     TCPServer(int(port), HTTPFactory(RedirectRequest),
@@ -1147,7 +1152,7 @@
     def signalProcess(self, signal, name):
         """
         Send a signal to each monitored process
-        
+
         @param signal: the signal to send
         @type signal: C{int}
         @param startswithname: is set only signal those processes