SVNKit The only pure Java™ Subversion client library in the world!

Home Get Library Knowledge Base Licensing

Configuring SVNKit

This section contains information on configuring the SVNKit library - in order that one can adjust the library up to his individual wishes. Here you will find information on what configuration files SVNKit uses during rungtime, what system properties are used in that case when config files are not available, and so on.

HTTP proxy setup

By default SVNKit uses proxy settings from the servers configuration file that is located in the default SVN run-time configuration area.

SVN+SSH authentication with private key

By default SVNKit tries to obtain all necessary information from the [tunnels] section of the config file that is located in the default SVN run-time configuration area. However if that information is not complete or not found at all, SVNKit tries then to use predefined system properties listed beneath.

SVNKit uses pure java JSCH library to establish SSH connection. This library supports only SSH version 2, with password or private key authentication. Using password authentication is not a problem with Subclipse, but currently it doesn't provide a way to define private key and passphrase for private key authentication. You may use the following properties to let SVNKit know about your private key and passphrase (you need to provide these properties when starting Eclipse):

$ eclipse -vmargs \ 
-Dsvnkit.ssh2.key=/path/to/private/key/file \
-Dsvnkit.ssh2.username=userName \ 
-Dsvnkit.ssh2.passphrase=optionalPassphrase \
-Dsvnkit.ssh2.password=userpassword
-Dsvnkit.ssh2.port=optionalPort

Note: User name for ssh connection will be taken from SVN Repository properties that may be altered in Subclipse SVN Repositories view.

To avoid special batch script creation to launch Eclipse you may define ssh related properties in Eclipse config.ini file ECLIPSE_HOME/configuration/config.ini (tip provided by Andrew Berman):

  ...
  svnkit.ssh2.key=path/to/private/key/file
  svnkit.ssh2.passphrase=passphrase
  svnkit.ssh2.username=username
  svnkit.ssh2.password=userpassword 
  svnkit.ssh2.port=port

In case you work with Mac OS X version of Eclipse it is not too simple to add arguments that make JSCH look for private key file at launch. Instead of command line arguments you can modify Eclipse.app/Contents/Info.plist last array of keys adding something like that (tip provided by Valentin Alekseev):

<array>
  ...
   <string>-Dsvnkit.ssh2.key=/path/to/key/file</string>
</array>

SSL Connections

SVNKit uses SSL support included into JDK. Some JDK versions don't support SSL server certificates longer than 1024 bytes or don't support certain Cypher Suites. If you're experiencing problems accessing a Subversion repository over SSL connection (via https protocol) consider using the latest JDK version and upgrading the JDK JCE package (Cryptotgraphic Extension) to an "unlimited strenght" one. Read this article for more details on how to install JCE.

Trusting SSL Certificates

If SVNKit is used as a standalone library and no custom authentication provider is registered, SVNKit:

  • by default trusts all SSL servers, though it doesn't cache server certificates;
  • or uses a default JDK certificates storage to get SSL certificates of the trusted servers;
  • and additionally it uses authority certificate files listed in the Subversion servers configuration file in these options:
    ### 'ssl-authority-files' is a semicolon-delimited list of files,
    ### each pointing to a PEM-encoded Certificate Authority (CA) 
    ### SSL certificate.
    ssl-authority-files = /path/to/CAcert.pem;/path/to/CAcert2.pem
    
    ### 'ssl-trust-default-ca'       Trust the system 'default' CAs
    ssl-trust-default-ca = yes
    

Client SSL authentication

In the Subversion servers configuration file you can specify your SSL authentication certificate files for a specific group:

ssl-client-cert-file      PKCS#12 format client certificate file
ssl-client-cert-password  Client Key password, if needed.
Read more information on this options in the Subversion book.



If you have any questions regarding SVNKit, would like to report a bug or contribute a patch, please write to support@svnkit.com


Java™ and all Java-based marks are a trademark or registered trademark of Sun Microsystems, Inc, in the United States and other countries. TMate Software and the website svnkit.com are independent of Sun Microsystems, Inc. and have no relationship, formal or informal.