March
2010

Permanently accepting invalid certificates in SVN

My preferred SVN client is Versions, the best SVN client I have ever seen and by far the best on the Mac. Versions is probably the main reason I prefer SVN over Git, it just makes SVN extremely usable. However there was one issue that has been driving me crazy over the last couple of months.

Versions was always complaining that our server certificate was invalid. Like with SVN on the command line you can then decide to reject, accept or permanently accept the certificate. However accepting it permanently would not make a difference, the same message would keep popping up every few minutes, very annoying. So I tasked our server guys with fixing the certificate, which in the end didn’t make a difference. I then tried to connect locally via svn+ssh rather than https which fixed it only for certain repositories. Today we finally found out how to solve it permanently.

It turned out the problem was that SVN couldn’t update the certificate settings in my home folder, because the files were owned by root and not by my user. I never noticed that because the directory itself was owned by me. Anyway I noticed heaps of people have similar problems with permanently accepting invalid certificates, so here’s how to fix it. This is based on Mac OS but might also apply to other systems.

  • Open a terminal and go to your home directory.
  • Typing ls -la should list a hidden directory .subversion, owned by you.
  • Type cd .subversion and then try again with ls -la. If the files inside the directory are owned by root, then that’s the problem.
  • Change the ownership with sudo chown -R your_user:staff * and replace your_user with your username.

All certificate errors should now be gone and permanently accepting an invalid one will work fine.

Comments

  • Excellent, thanks for the tip.