Fazal Majid's low-intensity blog

Sporadic pontification

Fazal Fazal

Fixing Mac software update NSURLErrorDomain error -1012

Software Update for system components on my home Mac Pro has not worked in a while, and I have had to resort to manually downloading and applying updates. The updates just wouldn’t appear in the Mac App Store app where they normally should.

After upgrading to Mavericks, I finally figured out why. Instead of silently ignoring the updates, Mavericks displays a not-so-helpful error message “NSURLErrorDomain Error -1012”. On inspecting network traffic from the App Store app, I noticed it connects using TLS 1.2 to swdist.apple.com, then aborts. It then hit me – in 2011, after Comodo was hacked, apparently by elements affiliated with the Iranian government, I revoked the trust setting on their root certificates. The certificate for swdist.apple.com is signed by Comodo, and thus Software Update could no longer establish a secure connection to Apple and that’s why it was failing.

This is not the only time a Certificate Authority was hacked. Dutch CA Diginotar, which included the Dutch government among its clients, suffered a breach, apparently also involving Iran. Microsoft, Mozilla, Google and Apple promptly revoked Diginotar’s root CA certificates, which quickly led to the company going out of business. I guess Comodo is larger (the EFF calls them “too big to fail”) and better politically connected (it helps when you have people like Phillip Hallam-Baker on the payroll), and managed to elude the same punishment it richly deserved.

Apple should really step up its game and ditch a security provider which demonstrated incompetence at its alleged core competency, and I filed Radar bug report 15328323 to urge them to do so. In the meantime, the way to fix the error message is to temporarily reinstate trust in the Comodo root CA.

Update (2015-10-29)

At some point in the last 2 years they switched from Comodo to Symantec (probably 2014-04-13 when the current certificate was issued). Unfortunately, Symantec has its own problems.

Afsheen’s mindset list

Beloit College is famous for its Mindset List, which explains to teachers the radically different world view students have, because their assumptions and experience are different. One example from this year’s list: “GM means food that is Genetically Modified”.

I tried to imagine what the list looks like when my daughter starts University.

Some are no-brainers, as they have already occurred:

  • A phone call has always involved both video and sound
  • A computing device is always touch-enabled

For some others, I may have to go out on a limb:

  • Cars have always been self-driving

Update (2015-08-25):

  • House roofs have always been tiled with solar panels

Vancouver vacation tips

  • Swan Laundry will pick up your laundry at your hotel, wash and fold it, and return it the same day for a $50 flat fee.
  • Wind Mobile has an unlimited 3G hotspot plan for $35 per month (they will throttle you if you exceed 10GB in a month), a better deal than any US carrier offers. They sold me a refurbished Huawei hotspot for $45 (why should the NSA have all the fun listening in?)
  • Urban Fare is an excellent place for breakfast and fancy groceries, specially the Shangri-La location.
  • The Blue Water Cafe is my favorite restaurant in town.

The Wild Parrots of Forest Hill

Street sweeping reminders in iCal

Parking signSan Francisco sweeps streets twice a month in residential neighborhoods, and you will be fined if your car is parked on a street being swept. On my street, the schedule is the first and third Monday of each month, between 9am and 11am. I was trying to create reminders to myself in my calendar. Unfortunately, iCal does not have the ability to specify a recurring event with that definition.

No matter, Python to the rescue, the script below generates a year’s worth of reminders 12 hours before the event, in iCal vCalendar format. It does not correct for holidays, you will have to remove those yourself.

#!/usr/bin/python
"""Idora street sweeping calendar - 1st and 3rd Mondays of the month 9am-11am"""
import datetime
Monday = 0
one_day = datetime.timedelta(1)
today = datetime.date.today()
year = today.year
month = today.month

def output(day):
  print """
BEGIN:VEVENT
DTEND:%(end)s
SUMMARY:Idora street sweeping
DTSTART:%(start)s
BEGIN:VALARM
TRIGGER:-PT12H
ATTACH;VALUE=URI:Basso
ACTION:AUDIO
END:VALARM
END:VEVENT
""" % {
    'end': day.strftime('%Y%m%dT110000'),
    'start': day.strftime('%Y%m%dT090000')
    }

print """BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0"""

for i in range(12):
  day = datetime.date(year, month, 1)
  while day.weekday() != Monday:
    day += one_day
  output(day)
  output(day + 14 * one_day)
  month += 1
  if month > 12:
    month = 1
    year += 1

print "END:VCALENDAR"