[CalendarServer-changes] [5477] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 14 10:26:56 PDT 2010


Revision: 5477
          http://trac.macosforge.org/projects/calendarserver/changeset/5477
Author:   glyph at apple.com
Date:     2010-04-14 10:26:55 -0700 (Wed, 14 Apr 2010)
Log Message:
-----------
Allow MetaFD configuration to work in the absence of any valid SSL certificates.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/caldav.py
    CalendarServer/trunk/twext/web2/metafd.py

Modified: CalendarServer/trunk/calendarserver/tap/caldav.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/caldav.py	2010-04-13 20:29:21 UTC (rev 5476)
+++ CalendarServer/trunk/calendarserver/tap/caldav.py	2010-04-14 17:26:55 UTC (rev 5477)
@@ -642,8 +642,17 @@
 
             fd = int(config.MetaFD)
 
+            try:
+                ctxFac = self.createContextFactory()
+            except SSLError, e:
+                self.log_error("Unable to set up SSL context factory: %s" % (e,))
+                # None is okay as a context factory for ReportingHTTPService as
+                # long as we will never receive a file descriptor with the
+                # 'SSL' tag on it, since that's the only time it's used.
+                ctxFac = None
+
             ReportingHTTPService(
-                site, fd, self.createContextFactory()
+                site, fd, ctxFac
             ).setServiceParent(service)
 
         else: # Not inheriting, therefore we open our own:

Modified: CalendarServer/trunk/twext/web2/metafd.py
===================================================================
--- CalendarServer/trunk/twext/web2/metafd.py	2010-04-13 20:29:21 UTC (rev 5476)
+++ CalendarServer/trunk/twext/web2/metafd.py	2010-04-14 17:26:55 UTC (rev 5477)
@@ -42,6 +42,19 @@
     """
     Service which starts up an HTTP server that can report back to its parent
     process via L{InheritedPort}.
+
+    @ivar site: a twext.web2 'site' object, i.e. a request factory
+
+    @ivar fd: the file descriptor of a UNIX socket being used to receive
+        connections from a master process calling accept()
+
+    @type fd: C{int}
+
+    @ivar contextFactory: A context factory for building SSL/TLS connections
+        for inbound connections tagged with the string 'SSL' as their
+        descriptive data, or None if SSL is not enabled for this server.
+
+    @type contextFactory: L{twisted.internet.ssl.ContextFactory} or C{NoneType}
     """
 
     _connectionCount = 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100414/7ca73feb/attachment.html>


More information about the calendarserver-changes mailing list