iOS certificates are "Expired" despite being brand new

I have just generated a new set of certificates and provisioning profiles for iOS deployment and imported them into Unreal. These new certificates are apparently “Expired” despite not actually expiring for 12 months from now.

I double-checked the certificates in Keychain Access and they are definitely valid:

My guess is that there’s some timezone conversion error happening here. I’m in Melbourne, Australia, and it’s currently Daylight Saving time, so we’re UTC+11:00. At time of writing, my system time is reported as Thu 22 Oct 2015 12:22:10 AEDT. I’m hoping this will correct itself in the next day or so, but it’s a fair inconvenience given that I was hoping to get everything packaged up for submission today.

Below is the log output generated from opening the iOS settings section in Project Settings. Please note that I have replaced the certificate names/IDs with Xs.

CERTIFICATE-Name:iPhone Developer: XXX XXXXXXXX (XXXXXXXXXX),Validity:VALID,StartDate:2015-09-11T14:28:17.0000000+10:00,EndDate:2016-09-10T14:28:17.0000000+10:00
CERTIFICATE-Name:iPhone Distribution: XXX XXXXXXXX (XXXXXXXXXX),Validity:VALID,StartDate:2015-09-14T09:20:28.0000000+10:00,EndDate:2016-09-13T09:20:28.0000000+10:00
CERTIFICATE-Name:iPhone Developer: XXX XXXXXXXX (XXXXXXXXXX),Validity:EXPIRED,StartDate:2015-10-22T10:34:55.0000000+11:00,EndDate:2016-10-21T10:34:55.0000000+11:00
CERTIFICATE-Name:iPhone Distribution: XXX XXXXXXXX (XXXXXXXXXX),Validity:EXPIRED,StartDate:2015-10-22T10:41:06.0000000+11:00,EndDate:2016-10-21T10:41:06.0000000+11:00

Incidentally, you’ll notice that there are two sets of certificates in the screenshot and log output. The “Valid” ones are from my developer account, which I was using temporarily, and the new “Invalid” ones belong to my client, for whom I have just set up a developer account. How do I remove the old certificates? I’ve checked in DefaultEngine.ini, but there are no entries related to this in there.

UPDATE: I waited a day and the certificates are now being reported as “Valid”. There’s definitely some dodgy date comparison logic in there somewhere.

+1 there’s a bug with date comparison in iPhonePackager.exe. My Mac is on British Summer Time and it happens for me:
My old certificate got marked as expired a day too soon, and then newly created certificates are marked as expired for the first day.

I guess the way to reproduce it:

  1. Set your timezone to british summer time.
  2. Make new certificate
  3. Run /Engine/Build/BatchFiles/Mac/ /Engine/Binaries/DotNET/IOS/iPhonePackager.exe certificates - your newly created certificate is marked as “Expired”.
  4. Change your date to 2 days in to the future and run the same command again - now your newly created certificate is valid.

Please add to JIRA if it’s not there yet.

I also encountered the same problem today.

I tried to generate a new certificate and update the provisioning file several times, however it always says my certificate is “expired”. Actually it is valid and works properly within XCode.

According to @rohoon 's suggestion, I am going to wait for one day until this problem resolves itself. I will keep update this thread then.

I want to confirm this issue exists in Unreal Engine 4.10.4 as well. On Mac OS X 10.11.4 El Capitan, the quick fix to get it valid immediately is to set the system date of OS X directly to one day ahead. Restart your Unreal Engine 4 project, and your certificates should now be valid.

Don’t forget to reset your date after completing the build or finishing your work.

This is a less than ideal solution, but may assist others in this situation as well. This should also work on Windows and Linux as well, so long as you have permission to adjust your system’s date.