SVNKit Authentication Using SSL and Certificate

New to here at SVNKit. I find it difficult to find an authentication method in my svn repository.

Basically, when I connect to my repository using the SVN code from the command line, it tells me that I accept a certificate and ask for a name and password for my name. It also uses https.

But using the code I see from the wiki, it says something like this, but it does not work.

ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password); 

I read somewhere about creating my own authentication provider, but I can’t find enough code to tell me how to do this.

How can I authenticate to svn repository using SSL and certificates?

+4
source share
1 answer

It depends on your goals, you can create a default auth manager:

 ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(); 

It uses the settings from the ~/.svn/ directory.

If you want the auth manager to request passwords / keys from the console, look at the implementation of SVNCommandEnvironment#createClientAuthenticationManager .

But you can also create the simplest auth manager by simply specifying credentials (the ~/.svn/ directory is not required for this option):

 ISVNAuthenticationManager authManager = new BasicAuthenticationManager(new SVNAuthentication[] {authentication1, authentication2, ...}); 

therefore, you simply pass in an instance of SVNSSLAuthentication (containing the correct certificate file and passphrase) as one of the elements of the array. SVNKit will verify these authentications to success.

+3
source

Source: https://habr.com/ru/post/1440448/


All Articles