The only pure Java Subversion library in the world!
Home Get Library Knowledge Base Licensing

Supported system properties and configuration options

This section contains information on configuring the JavaSVN library - in order that one can adjust the library up to his individual wishes. Here you will find information on what configuration files JavaSVN 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 JavaSVN 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 JavaSVN 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, JavaSVN tries then to use predefined system properties listed beneath.

JavaSVN 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 a private key and passphrase for private key authentication. You may use the following system properties to let JavaSVN know about your private key and passphrase:

javasvn.ssh2.key = /path/to/private/key/file 
javasvn.ssh2.username = userName  
javasvn.ssh2.passphrase = optionalPassphrase 
javasvn.ssh2.password = userpassword
javasvn.ssh2.port = optionalPort

SVN+SSH authentication with private key in Eclipse

When starting Eclipse you can provide the above properties like this:

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

Note: a user name for an 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):

  ...
  javasvn.ssh2.key=path/to/private/key/file
  javasvn.ssh2.passphrase=passphrase
  javasvn.ssh2.username=username
  javasvn.ssh2.password=userpassword 
  javasvn.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>-Djavasvn.ssh2.key=/path/to/key/file</string>
</array>

SSL Connections

JavaSVN 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 JavaSVN is used as a standalone library and no custom authentication provider is registered, JavaSVN:

  • 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 JavaSVN, would like to report a bug or contribute a patch, please write to support@tmatesoft.com