When I run the svn command line from the Jenkins shell I get this error:
D:\\Jenkins\\jobs\\Merge Trunk to Stable\\workspace\\stable>svn up --trust-server-ce
This may seem like a horrible answer but after exhausting the other ones, which didn't work for me due to other issues, I choose to go the route of changing the SVN server to not use SSL.
This was only an option because I just setup this server and it's on a totally internal network, but it did eliminate the issue entirely. And I ran out of other options and time.
I also only suggest this incase someone doesn't realize it is even an option. Using SSL would make me feel much better regardless of the server exposure.
Pretty old question, but still quite alive.
As you know, the problem is that the accepted certificate cache (as well as the username/password cache) is per-user, and since Jenkins is running as a different user (most likely SYSTEM), it has no idea of your regular user cache.
Not all SVN clients let you do the "echo p" thing there (it didn't work for me), and the --trust-server-cert
apparently doesn't work in this case either.
What worked for me was to open a console window as SYSTEM, and do the interactive acceptcertificate-login-password dance in there.
Since all of this is cached, you only need to do this once, and from then on, all svn up
and similar requests will work.
echo p | svn commands
Worked great in Jenkins windows batch command prompt. Doing this once will permanently accept the certificate for the Jenkins user in the Build box.
Perhaps, the certificate is issued to a different hostname (not xxx, but something like xxx.yourcompany.com). If yes, then do a clean checkout with this hostname.
I finally managed to solve the problem! What I did is simply put in Jenkins script:
echo p | svn up --username <usr> --password <pwrd>
This solved it! since the echo emulated the manual input to accept permanently the certificate.
Root Cause is the fact that Jenkins shell scripts run under the windows service user - thus uses a different place for the user profile cache (in C:\Windows\System32\config\systemprofile\AppData\Roaming\Subversion
instead of %USERPROFILE%\AppData\Roaming\Subversion\
)
Running Svn commands through Jenkins on slave was giving me difficulty. I did the following:
If you are on unix then follow this link: http://www.microhowto.info/howto/configure_subversion_to_trust_a_given_ssl_certificate.html
If you are on Windows then do:
cd %APPDATA%\Subversion\
Then edit the server
file in that directory by removing the #
sign from the ssl-authority-files
element and update the path to where you stored your ssl certificate file.
Also change the following, if you like it to store your credentials.
store-passwords = yes
store-ssl-client-cert-pp = yes
Once that is done, you would also need to add the certificate to your windows machine by following Add the Cert to the Trusted Root CA Store