linux下svn鏈接上Visual SVN(win):報SSL錯誤 報錯

已經在windows2008上用visualSVN配置好了SVN服務器,而且在windows虛擬機的客戶端能夠正常使用。linux

    可是,今天在centos65上嘗試運行svn,就裝了一個subversion.可是使用時報了相似下面的錯:web

svn: 方法 OPTIONS 失敗於 「https://192.168.26.210/svn/xxx」: SSL handshake failed: SSL 錯誤:在證書中檢測到違規的密鑰用法。 (https://192.168.26.210)apache

 

上網找了一個英文的網頁,解決了該問題。如今記錄下來。vim

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

 

錯誤緣由是windows使用的證書linux不能識別。centos

改正方法是:修改服務器上visualsvn使用的證書爲第三方產生的證書,以便windows和linux都能識別。服務器

過程svn

 

  1. Add the following registry value to the Windows registry:()
    • for 32-bit system:(運行regedit->找到下面的註冊表項->增長一個dword類型的值)this

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

      [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VisualSVN\VisualSVN Server]
      "CreateGnuTLSCompatibleCertificate"=dword:00000001
  2. Start VisualSVN Server Manager.(打開virsualSVN server)
  3. Go to Action | Properties | Certificate.
  4. 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:

  1. 卸載 libneon 包
    sudo apt-get remove libneon27
  2. 安裝須要的 libssl 依賴。
    sudo apt-get install libssl0.9.8
  3. http://packages.debian.org/squeeze/libneon27 的頁面底部有最新的 libneon 包,下載系統對應的安裝包,而後用命令安裝。
    dpkg -i libneon27_0.29.3-3_amd64.deb
  4. 最後改變連接,命令以下:
    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
  5. 註銷用戶後就OK了。

 

3:

Centos 6.6

一、卸載自帶的svn和neon軟件包

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

二、下載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.一、安裝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.二、安裝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

四、添加svn到環境變量

vim /etc/profile

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

保存退出

source /etc/profile


五、驗證

執行命令 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.

相關文章
相關標籤/搜索