Closed awiseman closed 9 years ago
I found #120 "need to decode password for yum.conf". Can you try this one?
Unfortunately, I found that one too, as well as https://github.com/tmatilai/vagrant-proxyconf/issues/113. I tried escaping the character, specifying it via the env variable, and specifying it via "config.yum_proxy.http" in my vagrant file. None of them work :( I get this error message:
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/generic.rb:214:in `initialize': the scheme http does not accept registry part: user:123 (or bad hostname?) (URI::InvalidURIError)
The issue seems to be that the URI string fails to parse due to those characters. I use this test string:
http://user:123#abc@proxy.example.com:80
which would need to be encoded as the following to work as the http_proxy value
http://user:123%23abc@proxy.example.com:80
Here, the URI parser doesn't know that I'm not specifying something like:
http://host:port#hashpath
Would it be difficult to create a proxy, username, and password key for config.yum_proxy.* such that there is a 1-1 relationship between those values and what gets entered into /etc/yum.conf?
e.g.
if Vagrant.has_plugin?("vagrant-proxyconf")
config.yum_proxy.proxy = "http://proxy.example.com:80"
config.yum_proxy.username = "user"
config.yum_proxy.password = "123#abc"
end
@awiseman, I'm sorry, I had a mistake. #120 is not merged and closed. So we need new implementation for this issue.
The implementation should be upper compatible. So, how about the followings?
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy = "http://user:123%23abc@proxy.example.com:80"
config.proxy_url_encoded = true
end
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy = "http://user:123abc@proxy.example.com:80"
config.proxy_url_encoded = false
end
Sure, whichever makes the most sense.
Thanks :)
Already released on 1.5.2.
Currently, vagrant-proxyconf seems to require that proxy auth credentials be provided in URI-valid format (i.e. http://user>:<pass>@<host:). For usernames and passwords that contain URI reserved characters
, this requires that these characters be encoded to their corresponding %## value.
This works fine for the proxy environment variables (http_proxy, https_proxy, etc.). However, yum.conf specifies proxy auth credentials separately from the proxy URL.
If the username/password contains URI encoded characters, yum is unable to authenticate because it is expecting plain-text representations of these values.
I tried to find a work-around, but vagrant-proxyconf currently doesn't seem to allow the specification of auth credentials in any other format than URI encoded.