jammycakes
jammycakes

Reputation: 5866

Unknown protocol error when using git-svn over HTTPS through a proxy server

I've been encountering some problems attempting to access a Subversion repository via HTTPS using git-svn.

When I type git svn init --username=<my username> --trunk=https://<host>/<project>/trunk, I get the following error message:

RA layer request failed: PROPFIND request failed on '/<project>/trunk':
PROPFIND of '/<project>/trunk': SSL negotiation failed: SSL error: unknown
protocol (https://<host>) at C:\Program Files (x86)\Git/libexec/git-core\git-svn
line 2299

A couple of other points to note:

  1. I'm using msysgit 1.7.9.0 on Windows 7 x64. I also have the Subversion 1.7.1 command line client and TortoiseSVN 1.7.1 installed.
  2. I am connecting through a proxy server, which I have specified through both the HTTP_PROXY environment variable and git config http.proxy.
  3. I am able to clone Github repositories over HTTPS on the same machine without problems.
  4. The plain Subversion client checks out the same project without problems. I have also been able to clone it successfully with Mercurial and hgsubversion, although it did fail to recognise the server's SSL certificate, so I had to specify it explicitly in my mercurial.ini file. Because of this, I am using git config http.sslVerify=false. However, this does not make any difference.
  5. One-way workarounds such as using svnsync (as e.g. suggested here) are not an option.

Anything else that I haven't tried?

Upvotes: 5

Views: 4012

Answers (4)

jammycakes
jammycakes

Reputation: 5866

I've finally discovered how to get it to work. The answer came from this thread.

When you're connecting to a Subversion server through a proxy, git-svn doesn't use the proxy settings in .gitconfig, nor does it use the settings you configure in TortoiseSVN. Instead, it looks in the [global] section of %USERPROFILE%\.subversion\servers.

Adding our proxy server settings to this file allowed me to connect to an external Subversion server.

Upvotes: 0

Edward Thomson
Edward Thomson

Reputation: 78703

To expand a little bit on the other two answers (and explain why you're seeing what you're seeing), git svn (as part of msysgit) is built against svn 1.4.6:

C:\> git svn --version
git-svn version 1.7.7.1.msysgit.0 (svn 1.4.6)

Note that 1.4.6 is... well... old. (And hasn't even been supported since 1.6 was released in 2009.)

msysgit's git-svn is not using your subversion install - so being able to checkout using your installed svn is (unfortunately) not indicative of the problem.

There are some bug reports about upgrading to a newer subversion for msysgit, but it appears that those have not yet materialized.

Have you tried cygwin's git-svn?

Upvotes: 9

MrGomez
MrGomez

Reputation: 23886

Offering a slightly less terse answer, kan is correct. The reason why you are seeing this is your upstream repository isn't properly configured for SVN+HTTPS. This can be due to a misconfiguration at the server end, or it can be due to a difference in the SVN protocol being served versus what your client expects.

The errata provides the correct debugging scenarios for this problem. If you have control over the SVN repository in question, please ensure its HTTPS configuration is working properly to proceed using this as your upstream repository. If you wish to change the protocol or URL being used to further troubleshoot the connection (for example, to try over HTTP or SSH), here's the guide you'll need.

Upvotes: 1

kan
kan

Reputation: 28961

The message you are getting (SSL23_GET_SERVER_HELLO:unknown protocol) is easy to google. E.g. here or here Looks like you have the https or dns servers misconfigured and nothing to do with git.

Upvotes: 1

Related Questions