13

I'm trying to create a post-commit.bat script so that every time someone commits, a working copy automatically updates. This is my post-commit.bat:

"C:\Program Files\TortoiseSVN\bin\svn.exe" update C:\Temp\PROD --non-interactive --trust-server-cert --username admin --password myPassword

This is the error message I'm getting:

svn: E230001: Unable to connect to a repository at URL
'https://svn.mydomain.com/svn/prod/trunk'
svn: E230001: Server SSL certificate untrusted

It looks like the --trust-server-cert option is ignored for some reason. Interestingly, calling the batch file from cmd window works fine.

I'm using Subversion Edge server and TortoiseSVN client on Windows Server 2008.

Anybody has any ideas what I'm doing wrong? Any help would be appreciated.

LEC

sergtk
  • 10,714
  • 15
  • 75
  • 130
lecnt
  • 353
  • 1
  • 3
  • 9
  • 1
    I have similar issue. I tried to call batch file from Jenkins with svn command. The same result as you described. And it also works fine from command line – sergtk Aug 25 '13 at 21:01

2 Answers2

3

In my case (SVN client 1.8.1) the --trust-server-cert flag did also not work. After finding this http://mail-archives.apache.org/mod_mbox/subversion-users/201308.mbox/%3CCABw-3Ye6rk-zwjM7jZL-zPvSDDeH=+1ebH9O0e5163rZETOG9A@mail.gmail.com%3E I upgraded to SVN 1.8.4 and the script works well. The --trust-server-cert flag is fixed.

ZoolWay
  • 5,411
  • 6
  • 42
  • 76
  • No, the client can update fine while not used of course. I updated just the svn client binaries the script on the server uses - not the server itself. – ZoolWay May 12 '14 at 16:52
2

I have fixed this by issuing new certificate with Common Name (CN) equal to server name.

I was able to use certificate with CN server name mismatch from browsers (with warnings) and svn command line. But was not able to use certificate within batch file which is called from Jenkins.

I use SVN client 1.8.1 under Win32.

I have also tried before, but it does not helped:

Community
  • 1
  • 1
sergtk
  • 10,714
  • 15
  • 75
  • 130
  • Don't use `--trust-server-cert`, as it will basically render encryption useless by making man-in-the-middle attacks possible. The remaining steps seem solid, though. – Florian Winter Apr 25 '19 at 12:07