[CalendarServer-changes] [9092] CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 13 11:47:08 PDT 2012


Revision: 9092
          http://trac.macosforge.org/projects/calendarserver/changeset/9092
Author:   glyph at apple.com
Date:     2012-04-13 11:47:08 -0700 (Fri, 13 Apr 2012)
Log Message:
-----------
remove some duplication

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/client/pool.py
    CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py

Modified: CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/client/pool.py
===================================================================
--- CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/client/pool.py	2012-04-13 18:47:03 UTC (rev 9091)
+++ CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/client/pool.py	2012-04-13 18:47:08 UTC (rev 9092)
@@ -24,14 +24,16 @@
 import urlparse
 
 from twext.python.log import LoggingMixIn
+from twext.internet.gaiendpoint import GAIEndpoint
+from twext.internet.adaptendpoint import connect
+
 from twext.internet.ssl import ChainingOpenSSLContextFactory
 
 from twisted.internet.defer import Deferred, inlineCallbacks, returnValue
 from twisted.internet.error import ConnectionLost, ConnectionDone, ConnectError
 from twisted.internet.protocol import ClientFactory
+
 from twext.web2 import responsecode
-from twext.internet.gaiendpoint import GAIEndpoint
-from twext.internet.adaptendpoint import connect
 from twext.web2.client.http import HTTPClientProtocol
 from twext.web2.http import StatusResponse, HTTPError
 from twext.web2.dav.util import allDataFromStream

Modified: CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py
===================================================================
--- CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py	2012-04-13 18:47:03 UTC (rev 9091)
+++ CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py	2012-04-13 18:47:08 UTC (rev 9092)
@@ -31,12 +31,12 @@
 from twext.web2.stream import MemoryStream
 
 from twext.python.log import Logger, logLevels
-from twext.internet.ssl import ChainingOpenSSLContextFactory
 from twext.web2.dav.http import ErrorResponse
 
+from twistedcaldav.client.pool import _configuredClientContextFactory
+
 from twistedcaldav import caldavxml
 from twistedcaldav.caldavxml import caldav_namespace
-from twistedcaldav.config import config
 from twistedcaldav.scheduling.delivery import DeliveryService
 from twistedcaldav.scheduling.ischeduleservers import IScheduleServers
 from twistedcaldav.scheduling.ischeduleservers import IScheduleServerRecord
@@ -45,8 +45,6 @@
 from twistedcaldav.scheduling.cuaddress import PartitionedCalendarUser, RemoteCalendarUser,\
     OtherServerCalendarUser
 
-import OpenSSL
-
 """
 Handles the sending of iSchedule scheduling messages. Used for both cross-domain scheduling,
 as well as internal partitioning or podding.
@@ -176,7 +174,7 @@
         try:
             from twisted.internet import reactor
             if self.server.ssl:
-                context = ChainingOpenSSLContextFactory(config.SSLPrivateKey, config.SSLCertificate, certificateChainFile=config.SSLAuthorityChain, sslmethod=getattr(OpenSSL.SSL, config.SSLMethod))
+                context = _configuredClientContextFactory()
                 proto = (yield ClientCreator(reactor, HTTPClientProtocol).connectSSL(self.server.host, self.server.port, context))
             else:
                 proto = (yield ClientCreator(reactor, HTTPClientProtocol).connectTCP(self.server.host, self.server.port))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120413/4c902083/attachment-0001.html>


More information about the calendarserver-changes mailing list