解决ubuntu下svn下载代码出现的SSL error问题

由于习惯问题, 一直在ubuntu 下开发一些程序, 同事都是在window下面, 所以经常会出现一些问题.  最近装了64位ubuntu12.04版本.  sudo apt-get install svn 后, 出现如下的错误.

SSL handshake failed: SSL error: Key usage violation in certificate has been

原因, 以前查过, 就是svn发布的安装包不再使用OpenSSL, 采用的GnuTLS. 原文如下:

 

 

Subversion clients receive the following error message when attempting to connect to VisualSVN Server:

svn: OPTIONS of 'https://server.domain.local/svn/repo': SSL handshake failed: SSL error:
Key usage violation in certificate has been detected. (https://server.domain.local)

You may experience the issue if both of the following conditions are met:

  • VisualSVN Server has a self-signed certificate applied and
  • Subversion client is built against the GnuTLS library.
Note
NoteGnuTLS library is an alternative to OpenSSL. Most Subversion clients for Windows are built against OpenSSL and are not affected by this issue. While some Subversion packages (available mostly on Linux-based operating systems such as Ubuntu and Debian) are built against GnuTLS and are affected.

 

一种方法是修改svn服务器, 这个对于我怕影响同事开发.

另外一种方法是, 修改libneon-gnutls 指向一个空的地方. 这个方法不好用, 并且觉得也不是一个好的方案. 最后决定换是编译源代码.

注: 把svn切换到最新的deb地址ppa:dominik-stadler/subversion-1.7, 也出现同样的错误.

 

在32bit ubuntu12.04的时候曾经下载了svn1.7.8的代码,  所以也没有下载最新推荐的1.8.1的包.

 

cd subversion-1.7.8/

依次运行下面的命令

./get-deps.sh

    这个命令是获取一下依赖的第三方的源码.

./configure --prefix=/usr/local/subversion --with-ssl --with-neon

     你可以修改--perfix后面的路径, 后面的参数一定要有--with-ssl

     中间提示出现缺少一些包, 根据提示安装就可以了

make

sudo make install

 

最后说明一下的是, 安装的程序在 /usr/local/subversion目录下面, 把 PATH环境变量里面加入 /usr/local/subversion/bin. 搞定

 

运行svn --version 

是1.7.8 

同一文章:  

http://lazy-luo.iteye.com/blog/1926391

 

 

你可能感兴趣的:(SVN,ubuntu,subversion)