Unknown protocol error when using git-svn over HTTPS through a proxy server
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:
- I’m using msysgit 22.214.171.124 on Windows 7 x64. I also have the Subversion 1.7.1 command line client and TortoiseSVN 1.7.1 installed.
- I am connecting through a proxy server, which I have specified through both the HTTP_PROXY environment variable and
git config http.proxy.
- I am able to clone Github repositories over HTTPS on the same machine without problems.
- 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.
- One-way workarounds such as using svnsync (as e.g. suggested here) are not an option.
Anything else that I haven’t tried?
4 Solutions collect form web for “Unknown protocol error when using git-svn over HTTPS through a proxy server”
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 126.96.36.199.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.)
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
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.
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.
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
Adding our proxy server settings to this file allowed me to connect to an external Subversion server.