Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH key auth with custom port in configuration for git server doesn't save / work #94

Closed
mxtm opened this issue Jun 13, 2015 · 15 comments
Closed
Milestone

Comments

@mxtm
Copy link

mxtm commented Jun 13, 2015

If you import an SSH key, set the git server to use ssh-key auth, enter a custom SSH port, and press save, it doesn't actually save nor work for syncing.

@mxtm mxtm changed the title I SSH key auth and custom port in configuration for git server don't save / work Jun 13, 2015
@mxtm mxtm changed the title SSH key auth and custom port in configuration for git server don't save / work SSH key auth with custom port in configuration for git server doesn't save / work Jun 13, 2015
@mxtm
Copy link
Author

mxtm commented Jun 13, 2015

Jeez, I can't type nor speak English properly today, sorry

@zeapo
Copy link
Contributor

zeapo commented Jun 14, 2015

Fixed in 1.2.0.21

@mxtm
Copy link
Author

mxtm commented Jun 15, 2015

It isn't fixed on my end; will update with the exact behavior.

Thanks for the quick response & update, wow!

... I didn't mean to close this, could you reopen it? Thanks.

@mxtm mxtm closed this as completed Jun 15, 2015
@zeapo zeapo reopened this Jun 15, 2015
@mxtm
Copy link
Author

mxtm commented Jun 16, 2015

So, I have the repo information filled in, correct username, server, repo path, etc. The resulting URL is the same I use to clone and pull on my laptop.

It saves now, but if I go to either "Synchronize repository" or "Pull from remote" and press enter for no passphrase, it throws:

Internal exception occurred
Message from jgit:
Attempt to get length of null array

After a few seconds of "Running command...".

@zeapo
Copy link
Contributor

zeapo commented Jun 16, 2015

How did you get your repository on your phone? Was it by cloning using this path, or creating a new repository then adding the server information?

@mxtm
Copy link
Author

mxtm commented Jun 16, 2015

Cloning using the path. I created the repository on the server. I was using the same repo that used to have the old connection information, however; I'll try re-cloning the repo from scratch after clearing the cache & data of the app.

@mxtm
Copy link
Author

mxtm commented Oct 12, 2015

I'm still having this issue on the latest version from F-Droid, here is the error message I receive: https://i.imgur.com/8k8JeGC.png

(apologies for sucking at GH issues, did not mean to close & reopen...)

@mxtm mxtm closed this as completed Oct 12, 2015
@mxtm mxtm reopened this Oct 12, 2015
@rndstr
Copy link

rndstr commented Oct 12, 2015

FWIW I have that first error message Attempt to get length of null array as well in the Play Store version (1.2.0.28). I do «Clone existing», no custom port but ssh-key. The F-Droid version seems to be older than the Play Store and didn't yet find the time to build it myself

@wongma7 wongma7 mentioned this issue Oct 22, 2015
@atom-42
Copy link

atom-42 commented Nov 6, 2015

There is a workaround for this issue (v1.2.0.35 F-Droid), as part of it is git related and not Android-Password-Store related.

Let's say you want to use a repo with ssh-keys.
Using linux, if you would like to clone this repo you would use this command line :
git clone username@host:repo-name
and it would be ok, but you would like to use a custom ssh port, so you would try to adapt your command line :
git clone username@host:custom-port/repo-name
and it wouldn't work, with git you have to specify the protocol in your URL if you use a custom port with ssh (and haven't set it as default port in ssh_config file). So, the correct command line to clone your repository would be :
git clone ssh://username@host:custom-port/repo-name
and only then it would be ok.

The issue is the same in Android-Password-Store, if you want to use ssh protocol and a custom port, you have to add the protocol ssh:// in the 'resulting URL' field before the username.

Worked for me ^^

A good idea would be to systematically add the protocol in the 'resulting URL' field or the command line used internally.

wongma7 added a commit that referenced this issue Dec 23, 2015
…E not just CLONE (addresses #94, maybe some of the oddities observed in #137)
@hughdavenport
Copy link

It looks like the solution to this problem is to prepend ssh:// to the connection string for custom ports. For the root cause, which also makes #153 happen, it can be fixed by catching git errors and displaying to the user in a friendly way, which seems to be #219, so this bug in itself could probably just be closed.

@ti-mo
Copy link

ti-mo commented Jun 5, 2017

This issue still persists when the hostname resolves to an IPv6 address.

Error occured during the pull operation, Message from jgit: ssh://git@git.example.com:42/pass.git: Connection refused

The URL magically has ssh:// prepended when a custom port is given, so all good there. 👍

@hughdavenport
Copy link

Hmm, maybe that is a bug in jgit not supporting ipv6? Does it work fine with ipv4?

@ti-mo
Copy link

ti-mo commented Jun 12, 2017

@hughdavenport Actually, I can't get password-store to pull from IPv6 endpoints at all when there's a custom port involved. Tried through AAAA records, plain IPv6 addresses and addresses within square brackets, there are different errors everytime.

A quick search yields this, but perhaps there's an issue with the way password-store handles the URLs/addresses.

IPv4 works fine with plain addresses and hostnames. Can troubleshoot further if you can't reproduce.

@zeapo
Copy link
Contributor

zeapo commented Jun 13, 2017

Probably our fault :)

I will try to reproduce this.

@msfjarvis
Copy link
Member

This should be fixed after the logic was refactored in b94b52a.

@msfjarvis msfjarvis added this to the v1.7.0 milestone Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants