Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

share|improve this answer
    
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 '12 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 '13 at 21:37
add comment

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

share|improve this answer
2  
You don't need to give credit to yourself as your name is attached to the post already. –  Iain Apr 6 '13 at 20:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.