[CalendarServer-changes] [14801] CalendarServer/trunk/calendarserver/tap/util.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue May 19 10:18:03 PDT 2015
Revision: 14801
http://trac.calendarserver.org//changeset/14801
Author: sagen at apple.com
Date: 2015-05-19 10:18:02 -0700 (Tue, 19 May 2015)
Log Message:
-----------
Only attempt to get APN passphrase from the keychain if it's not in the config
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tap/util.py
Modified: CalendarServer/trunk/calendarserver/tap/util.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/util.py 2015-05-19 13:31:00 UTC (rev 14800)
+++ CalendarServer/trunk/calendarserver/tap/util.py 2015-05-19 17:18:02 UTC (rev 14801)
@@ -1365,17 +1365,18 @@
return False, message
# Verify we can acquire the passphrase
- try:
- passphrase = getPasswordFromKeychain(accountName)
- protoConfig.Passphrase = passphrase
- except KeychainAccessError:
- # The system doesn't support keychain
- pass
- except KeychainPasswordNotFound:
- # The password doesn't exist in the keychain.
- postAlert("PushNotificationCertificateAlert", [])
- message = "Cannot retrieve APN passphrase from keychain"
- return False, message
+ if not protoConfig.Passphrase:
+ try:
+ passphrase = getPasswordFromKeychain(accountName)
+ protoConfig.Passphrase = passphrase
+ except KeychainAccessError:
+ # The system doesn't support keychain
+ pass
+ except KeychainPasswordNotFound:
+ # The password doesn't exist in the keychain.
+ postAlert("PushNotificationCertificateAlert", [])
+ message = "Cannot retrieve APN passphrase from keychain"
+ return False, message
# Let OpenSSL try to use the cert
try:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150519/867ace0d/attachment.html>
More information about the calendarserver-changes
mailing list