Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree, Stash, HTTPS, and SSH

Matt Baker April 17, 2013

I have a new Stash server set up running on HTTPS, have Sourcetree installed, and when I try to clone a repository over SSH, I get this error from Sourcetree:

"This is not a valid source path / URL"

URL is formatted like so: https://username@git.domain.com/scm/project/repo.git

If I use SSH to pull the repo, it works fine.

SSH URL is formatted like so: ssh://git@git.domain.com:7999/project/repo.git

Can anyone point me at where to start looking at this problem? Only thing I can think of is something with Apache and mod_proxy not playing nice with Sourcetree.

8 answers

1 accepted

0 votes
Answer accepted
Matt Baker April 30, 2013

The actual problem was I didn't have the full SSL keychain file configured in /etc/apache2/httpd.conf.

Adding this line (and downloading the proper file from my SSL cert provider) fixed this behavior:

SSLCertificateChainFile "/etc/ssl/gd_bundle.crt"

0 votes
JohnB January 21, 2014

Just in case this help someone else:

I also could not push/pull/clone to our stash server from a rhel client using git over https. The repository was correctly setup and working but I mostly use SSH keys so I never had to push over https before but had no idea why it wasn't working. In my case I'm on a RedHat linux 6.x system using command line git.

If you are using the git 1.7.1 that yum would provide in RHEL/CentOS 6 (I was using 1.7.1-3.el6_4.1) you cannot do git push/pull on https and passing the password either on the command line or in the url (refused to try the abborant .netrc file).

I removed the yum provided git and git-perl and grabbed a newer one. This was just like I had to do when I built stash on a different RHER6 server. I used rpmforge 1.7.10 x86_64 rpm's for git and git-perl which solved the push via https issue.

0 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2013

Am I perhaps able to get the actual URL? You could GPG encrypt it if I gave you my public key. I'm thinking we need to put this issue on JIRA.

0 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2013

Just as a note, this has now been dealt with in JAC here. A workaround in the meantime is to specify the username in the URL as was shown above: https://username@git.domain.com/scm/project/repo.git

Matt Baker April 25, 2013

Keiran,

I'm already specifying a username in the URL, as shown above.

KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2013

Sorry Matt, I've commented on completely the wrong issue. I'm dealing with two similar ones. Ignore this post (I tried to delete but it won't let me)

0 votes
Matt Baker April 25, 2013

Kieran,

After doing some further digging on my own, I believe the problem to be related to the version of OpenSSL installed on my server (1.0.1) and the version of OpenSSL supported by Curl which gets installed with SourceTree.

If I run git clone https://username@git.domain.com/scm/project/repo.git I get this response:

Cloning into 'testing'...
error: error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112) while accessinghttps://username@git.domain.com/scm/project/repo.git/info/refs?service=git-upload-pack
fatal: HTTP request failed

A quick Google search returns various complaints around this related to OpenSSL, Curl, and version differences between client and server.

0 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 21, 2013

At the terminal, could you try doing "ssh -T git@git.domain.com" (-T for test). Either the URL is malformed or you truly have no access.

0 votes
Matt Baker April 17, 2013

Kieran,

Stash is running on it's default port 7990, and I followed your documentation about using mod_proxy with apache to serve that externally to HTTPS/443.

The URL I linked above is a cleaned up version of what comes straight out of the Stash interface when you click the Clone button. The majority of our devs work from home, or outside the firewall. I'd prefer to only open HTTPS/443 and that 7999 SSH port if possible.

0 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 17, 2013

If your SSH URL is specifying a port explicitly, is your HTTPS site configured for a specific port also? If so, perhaps specify that so your URL is https://username@git.domain.com:7999/scm/project/repo.git?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events