Safari not loading Gmail; Google/YouTube invalid certificate I've tried changing DNS servers to OpenDNS's, I've cleared my history and website data from Safari, and I've uninstalled all extensions… but the browser just won't load Gmail! Whether I click on Sign In at google.com or enter gmail.com in my address bar, the page just never loads.

Not sure if related, but when I try visiting YouTube, Safari says the certificate is invalid. I click to proceed anyway, and the page automatically redirects to https://ad.doubleclick.net/N6762/adi/mkt.ythome_1x1/;sz=1x1;tile=3;ssl=1;dc_yt=1;kga=-1;kgg=-1;klg=en-gb;kmyd=ad_creative_3;ytexp=931369,937426,900245,902410,924645,946201,936112,9405772;ord=1426347126252949? It's a blank page. What's up with the auto-redirection? When I try to visit youtube.com again, I get served a site with no stylesheet or images. google.com loads without a problem although Safari throws up the invalid certificate warning as well.

Gmail loads fine on the Safari-only guest account, if it helps. My hosts file is ok. I'm using OS X 10.10.1 and Safari 8.0.2.
A few things to check.

You said you uninstalled your extensions. Are they definitely gone? Check the following folder. It should be empty except for an Extensions.plist file.

/Users/YOURUSERNAME/Library/Safari/Extensions


You mentioned extensions but not plugins. Within Safari's preferences go to the Security tab and click on the button "Website Settings..." beside "Internet plug-ins". Uncheck anything you don't recognise there and try again. Especially, obviously, anything enabled for Google's sites.

Another thing to check is the proxy settings on your Mac. A quick way to access these is from the Advanced tab in Safari's preferences. There should be a "Change Settings..." button beside "Proxies" near the bottom of that tab that will launch System Preferences and take you right to the proxy settings. Hard to give you guidance beyond this, but look for any proxy settings that you haven't configured yourself.

One last thing to check for is malicious or buggy kernel extensions. While it's unlikely on Yosemite (as kernel extensions now need to be signed to load) it might be worth checking anyway. Open the Terminal application and type the following command it will list any kernel extensions that don't identify as coming from Apple.

kextstat | grep -v "com.apple"


Failing that a useful tool to help people diagnose problems is EtreCheck. Download and run it and paste the output into a Gist and update your question with the link.