2

I am running the following command:

svn info --non-interactive --trust-server-cert --no-auth-cache --xml "https://ommited/svn/YAMS"

Unfortunately, I am getting the following error:

?xml version="1.0" encoding="UTF-8"?>
<info>
svn: E175002: Unable to connect to a repository at URL 'https://ommited/svn/YAMS'
svn: E175002: OPTIONS of 'https://ommited/svn/YAMS': Server certificat
e verification failed: certificate issued for a different hostname, issuer is no
t trusted (https://ommited)

I thought if I put --non-interactive --trust-server-cert, it would ignore the self signed certificate problem. Am I doing something wrong here?

2 Answers 2

5

Your hostname does not match. Re-issue your certificate with correct hostname.

One of the odds in svn cmd is that --trust-server-cert will trust any CA, however it still checks for valid hostname and if cert is expired.

So use correct hostname to solve your problem.

And yes, this does not make sense :-)

See here for more information from svn mailinglist

2
  • It's odd - better to just disable SSL. Beter yet to actually use a cert that you trust and makes sense for the URL.
    – Ram
    Jun 19, 2012 at 17:58
  • Using a self-signed cert (even with the wrong host name) still provides a good measure of security by making sure that no one is sniffing your data while using Starbucks public Wifi. Obviously a proper cert from a trusted authority is better to prevent man-in-the-middle attacks, but if your choices are SSL with an untrusted cert or plain-text, the untrusted cert is better than no SSL.
    – Johnny
    Apr 6, 2013 at 21:37
2

run the following php code, to accept the certificate, very much like when you'll do manually, using command line (where you press 'p' to accept the certificate permanently):

<?php
header('Content-Type: text/plain; charset=UTF-8');
print( shell_exec('echo p | svn log --limit 4 c:/work/trunk  2>&1') );
?>

run it once, the cert. will be accepted, and now - run it 'as usual' (no need echo p anymore)

<?php
header('Content-Type: text/plain; charset=UTF-8');
print( shell_exec('svn log --limit 4 c:/work/trunk  2>&1') );
?>

Note the 2>&1 at the end. I recommend add it too. this way you can see the err-output (if having any).

credit goes to subversion-when-trust-server-cert-isnt-enough

1
  • Use yes p or yes t on Unix. Jul 21, 2015 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .