您的位置:首页 > 运维架构 > Linux

linux下svn连接上Visual SVN(win):报SSL错误 报错

2016-05-31 00:00 501 查看
已经在windows2008上用visualSVN配置好了SVN服务器,并且在windows虚拟机的客户端可以正常使用。

但是,今天在centos65上尝试运行svn,就装了一个subversion.但是使用时报了类似下面的错:

svn: 方法 OPTIONS 失败于 “https://192.168.26.210/svn/xxx”: SSL handshake failed: SSL 错误:在证书中检测到违规的密钥用法。 (https://192.168.26.210)

上网找了一个英文的网页,解决了该问题。现在记录下来。

原文:http://www.visualsvn.com/support/topic/00056/

错误原因是windows使用的证书linux不能识别。

改正方法是:修改服务器上visualsvn使用的证书为第三方产生的证书,以便windows和linux都能识别。

过程

Add the following registry value to the Windows registry:()

for 32-bit system:(运行regedit->找到下面的注册表项->增加一个dword类型的值)
[HKEY_LOCAL_MACHINE\SOFTWARE\VisualSVN\VisualSVN Server]
"CreateGnuTLSCompatibleCertificate"=dword:00000001


for 64-bit system:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VisualSVN\VisualSVN Server]
"CreateGnuTLSCompatibleCertificate"=dword:00000001


Start VisualSVN Server Manager.(打开virsualSVN server)

Go to Action | Properties | Certificate.

Click Change certificate... and follow the wizard instructions to generate a new self-signed certificate.

再次执行svn,会提示证书生成者不受信赖的警告,选择永久接受即可。

这样问题就解决了。

说一说产生的原因:

这是因为virtual svn在生成鉴权数据的时候使用了一个插件,而这个插件是OpenSSL支持的,但GnuTls是不支持的。详细的内容大家仔细看吧。感谢这篇文章的原作者,及散播者

就是svn发布的安装包不再使用OpenSSL, 采用的GnuTLS。

除了上面这种在服务器上解决外还有其它的方法。

1:

I have came across the solution for this as

sudo mv /usr/lib/libneon-gnutls.so.27 /usr/lib/libneon-gnutls.so.27.old
sudo ln -s /usr/lib/libneon.so.27 /usr/lib/libneon-gnutls.so.27

or

sudo apt-get install libneon27
cd /usr/lib
sudo rm libneon-gnutls.so.27
sudo ln -s /usr/lib/libneon.so.27 libneon-gnutls.so.27


2:

卸载 libneon 包
sudo apt-get remove libneon27


安装需要的 libssl 依赖。
sudo apt-get install libssl0.9.8

http://packages.debian.org/squeeze/libneon27 的页面底部有最新的 libneon 包,下载系统对应的安装包,然后用命令安装。
dpkg -i libneon27_0.29.3-3_amd64.deb


最后改变链接,命令如下:
sudo mv /usr/lib/libneon-gnutls.so.27 /usr/lib/libneon-gnutls.so.27.old
sudo ln -s /usr/lib/libneon.so.27 /usr/lib/libneon-gnutls.so.27


注销用户后就OK了。

3:

Centos 6.6

1、卸载自带的svn和neon软件包

yum -y remove subversion
yum -y remove neon neon-devel

2、下载svn和neon的源码包

cd /usr/local/src
wget http://www.webdav.org/neon/neon-0.29.0.tar.gz
wget http://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.5.2.tar.gz
wget http://mirrors.tuna.tsinghua.edu ... r-util-1.5.4.tar.gz
wget http://archive.apache.org/dist/subversion/subversion-1.6.6.tar.gz

3、开始解压缩安装

3.1、安装neon

tar zxf neon-0.29.0.tar.gz
cd neon-0.29.0
./configure --prefix=/usr/local/neon --enable-shared --with-ssl=openssl
make && make install

3.2、安装subversion

tar zxf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install

cd ..
tar zxf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make install

cd ..
tar zxf subversion-1.6.6.tar.gz
cd subversion-1.6.6
./configure --prefix=/usr/local/svn --with-neon=/usr/local/neon --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-ssl
make && make install

4、添加svn到环境变量

vim /etc/profile

PATH=$PATH:/usr/local/svn/bin
export PATH

保存退出

source /etc/profile

5、验证

执行命令 svn --version

svn, version 1.6.6 (r40053)
compiled Nov 3 2015, 13:41:17

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme

cd /usr/local/svn/bin/
ldd svn|grep ssl
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007fb33a874000)

这时,再次使用svn co检出代码,发现它会问你:(R)eject, accept (t)emporarily or accept (p)ermanently?

键入p回车,就该输入用户名和密码来认证了。

have a nice day.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: