[CalendarServer-changes] [14259] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Jan 7 11:41:38 PST 2015


Revision: 14259
          http://trac.calendarserver.org//changeset/14259
Author:   cdaboo at apple.com
Date:     2015-01-07 11:41:38 -0800 (Wed, 07 Jan 2015)
Log Message:
-----------
Fix sim to work with Twisted 14.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/util.py
    CalendarServer/trunk/contrib/performance/loadtest/ical.py

Modified: CalendarServer/trunk/calendarserver/tap/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/util.py	2015-01-07 18:17:29 UTC (rev 14258)
+++ CalendarServer/trunk/calendarserver/tap/util.py	2015-01-07 19:41:38 UTC (rev 14259)
@@ -580,8 +580,8 @@
         )
         root.putChild(".well-known", wellKnownResource)
         for enabled, wellknown_name, redirected_to in (
-            (config.EnableCalDAV, "caldav", "/principals",),
-            (config.EnableCardDAV, "carddav", "/principals",),
+            (config.EnableCalDAV, "caldav", "/principals/",),
+            (config.EnableCardDAV, "carddav", "/principals/",),
             (config.TimezoneService.Enabled, "timezone", "/stdtimezones",),
             (config.Scheduling.iSchedule.Enabled, "ischedule", "/ischedule"),
         ):

Modified: CalendarServer/trunk/contrib/performance/loadtest/ical.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/ical.py	2015-01-07 18:17:29 UTC (rev 14258)
+++ CalendarServer/trunk/contrib/performance/loadtest/ical.py	2015-01-07 19:41:38 UTC (rev 14259)
@@ -35,6 +35,7 @@
 
 from twext.internet.adaptendpoint import connect
 from twext.internet.gaiendpoint import GAIEndpoint
+from twisted.internet.ssl import ClientContextFactory
 
 from twisted.internet.defer import Deferred, inlineCallbacks, returnValue, \
     succeed
@@ -42,7 +43,8 @@
 from twisted.python.filepath import FilePath
 from twisted.python.log import addObserver, err, msg
 from twisted.python.util import FancyEqMixin
-from twisted.web.client import Agent, ContentDecoderAgent, GzipDecoder
+from twisted.web.client import Agent, ContentDecoderAgent, GzipDecoder, \
+    _DeprecatedToCurrentPolicyForHTTPS
 from twisted.web.http import OK, MULTI_STATUS, CREATED, NO_CONTENT, PRECONDITION_FAILED, MOVED_PERMANENTLY, \
     FORBIDDEN, FOUND
 from twisted.web.http_headers import Headers
@@ -349,6 +351,16 @@
 
 
 
+class WebClientContextFactory(ClientContextFactory):
+    """
+    A web context factory which ignores the hostname and port and does no
+    certificate verification.
+    """
+    def getContext(self, hostname, port):
+        return ClientContextFactory.getContext(self)
+
+
+
 class BaseAppleClient(BaseClient):
     """
     Implementation of common OS X/iOS client behavior.
@@ -421,7 +433,10 @@
         self.reactor = reactor
 
         # The server might use gzip encoding
-        agent = Agent(self.reactor)
+        agent = Agent(
+            self.reactor,
+            contextFactory=_DeprecatedToCurrentPolicyForHTTPS(WebClientContextFactory()),
+        )
         agent = ContentDecoderAgent(agent, [("gzip", GzipDecoder)])
         self.agent = AuthHandlerAgent(agent, auth)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150107/6ea7aae8/attachment.html>


More information about the calendarserver-changes mailing list