Error “The Recovery server could not be contacted.” when reinstalling macOS High Sierra.

Received the error “The Recovery server could not be contacted.” when reinstalling macOS High Sierra on a laptop which has not be used for quite a while.

Turns out the battery had been completely drained, causing the laptops internal clock to reset to NSDate’s default value (00:00:00 UTC on 1 January 2001).

I assume that the machine connects to the recovery servers over HTTPS. As such, the server’s certificate can not be verified because the date is too far off from the actual date. One might ask why Apple do not make things easier and simply update the time using NTP before accessing the update server — doing so might enable an attacker to execute an mitm attack. The least Apple could do is to ask the user to input a correct date. Which leads us to the following solution.

To fix this, access the terminal from within the recovery GUI and execute

date mmddHHMMyy

where:

  • mm is the month [01;12],
  • dd is the day of month [01;31],
  • HH is the hour of day [00;23],
  • MM is the minute of the hour [00:59], and
  • yy is the year [00;99].

Then try again to launch internet recovery.

Installing ftp and telnet on macOS High Sierra (and later versions).

Apparently, ftp and telnet have been removed from macOS High Sierra. Apple claim this is for security reasons.

Both ftp and telnet can be obtained from the GNU inetutils package, which is available in macports.

Given that macports is available on the system, install GNU inetutils by executing:

sudo port install inetutils

An execution of the above commands installs ftp and telnet under /opt/local/bin/