Hey Apple users:
If you're now experiencing hangs launching apps on the Mac, I figured out the problem using Little Snitch.
It's trustd connecting to http://ocsp.apple.com
Denying that connection fixes it, because OCSP is a soft failure.
(Disconnect internet also fixes.)
– @lapcatsoftware (Tweet)
Both of these solutions do the same thing and prevent connections to ocsp.apple.com so your computer doesn't hang anymore. Pick the one that you feel more comfortable with.
The solution involves visually editing your /etc/hosts file with the vi command-line editor. Original source is this tweet, with corrections from replies:
- Disconnect Internet (if possible)
- Open Terminal
- Run
sudo vi /etc/hosts - Type
G$(go to end of file) - Type
i, right arrow, enter - Type
0.0.0.0 ocsp.apple.com - Press esc then type
:xthen press enter to save and quit - Reconnect Internet (if you disconnected it)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderto flush DNS
This solution has the same effect as the above solution (appending a line to /etc/hosts) and involves only one command. If you're not familiar with the Terminal or vi, you should do this.
- Open Terminal
- Run
echo "127.0.0.1 ocsp.apple.com" | sudo tee -a /etc/hoststo append127.0.0.1 ocsp.apple.comto the end of/etc/hosts sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderto flush DNS
Thanks @gnb for this one-liner!
After you're done, your /etc/hosts file should look something like:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# (You might not have everything that's above this line, but your file should end with the line below)
127.0.0.1 ocsp.apple.com
You can type cat /etc/hosts in your Terminal to print the contents of the /etc/hosts file to your screen, if you want to verify.
Once Apple fixes this issue upstream, you should get rid of the changes that were made to the /etc/hosts file in the above procedure.
- Open Terminal
- Run
sudo vi /etc/hosts - Type
G$(go to end of file) - Make sure you're on the line that reads
127.0.0.1 ocsp.apple.com(i.e. the line you added). If you aren't, use your up and down arrow keys so your cursor is on that line. - Type
ddto delete the line. - Press esc then type
:xthen press enter to save and quit
If you're curious what the Online Certificate Status Protocol (OCSP) is/the impacts of this change, check out the links below.
You should probably follow the instructions above to get rid of the changes that were made as soon as Apple fixes the issue.
- Send traffic to 0.0.0.0 instead of 127.0.0.1 from @michaelmior (Source)
- Typo in ocsp, original tweet read "oscp" from @ofergayer (Source)
- Restarting may not be necessary from @danbenjamin (Source)
- Right arrow, not left arrow from @simon (Source)
- Alternate one-line solution from @gnb (Source)
There are still several of typos of
oscpinstead ofocspin this file.