So, for other reasons, I have been messing around with mitmproxy
, and was just able to get a repo clone through that working for this on a Vagrant Appliance VM I was testing with.
Steps I went through:
-
Downloaded and extracted the linux binaries for mitmproxy
: mitmproxy.org
-
Ran ./mitmproxy
(this was just extracted in to the home dir)
-
Updated my git
proxy settings to:
:git_repository_proxy:
:host: 127.0.0.1
:password:
:port: 8080
:user:
:scheme: http
:path:
-
When adding the repo, uncheck Verify Peer Certificate
since that tries to verify the peer of the proxy
, and not of the endpoint of the git
remote.
This allowed me to fetch the repo and the tags just fine. However, I did end up getting the following error:
Error: import failed: unknown attribute 'scope' for MiqAeInstance.
So seems like there is something wrong with the repo contents itself, but that is not related to the proxy or the git import having troubles.
My guess is there is something wrong with the proxy/firewall that isn’t allowing the connections to go through.
I was able to also test that things were working with the proxy by doing the following in a Rails console:
$ vmdb
$ bin/rails c
irb(main):001:0> GitRepository.where(:url => "https://github.com/rhtconsulting/miq-Utilities.git").first.update_repo
=> true
irb(main):002:0> # if you need to turn off ssl verification, you can do the following and re-run the above
irb(main):003:0> GitRepository.where(:url => "https://github.com/rhtconsulting/miq-Utilities.git").first.update(:verify_ssl => 0)
=> true
If the proxy doesn’t work, you will probably get an error like:
Traceback (most recent call last):
16: from bin/rails:4:in `<main>'
15: from bin/rails:4:in `require'
14: from railties (5.1.7) lib/rails/commands.rb:16:in `<top (required)>'
13: from railties (5.1.7) lib/rails/command.rb:44:in `invoke'
12: from railties (5.1.7) lib/rails/command/base.rb:63:in `perform'
11: from thor (1.0.1) lib/thor.rb:392:in `dispatch'
10: from thor (1.0.1) lib/thor/invocation.rb:127:in `invoke_command'
9: from thor (1.0.1) lib/thor/command.rb:27:in `run'
8: from railties (5.1.7) lib/rails/commands/console/console_command.rb:97:in `perform'
7: from railties (5.1.7) lib/rails/commands/console/console_command.rb:17:in `start'
6: from railties (5.1.7) lib/rails/commands/console/console_command.rb:62:in `start'
5: from (irb):1
4: from app/models/git_repository.rb:89:in `update_repo'
3: from app/models/git_repository.rb:83:in `with_worktree'
2: from app/models/git_repository.rb:188:in `handling_worktree_errors'
1: from app/models/git_repository.rb:191:in `rescue in handling_worktree_errors'
MiqException::MiqUnreachableError (SSL connections to proxy are not supported)