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

Using proxy_server and/or proxy_port has no effect on Windows #277

Closed
TeunRoefs opened this issue May 2, 2017 · 10 comments
Closed

Using proxy_server and/or proxy_port has no effect on Windows #277

TeunRoefs opened this issue May 2, 2017 · 10 comments

Comments

@TeunRoefs
Copy link

TeunRoefs commented May 2, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.8.1
  • Ruby: 1.9.3
  • Distribution: -
  • Module version: 1.3.0

How to reproduce (e.g Puppet code you use)

archive { "C:\\Windows\\Temp\\SysinternalsSuite.zip":
      ensure       => present,
      source       => 'https://live.sysinternals.com/files/SysinternalsSuite.zip',
      proxy_server => 'http://1.2.3.4:3120', #use own proxy here
      cleanup      => false,
}

What are you seeing

Absolutely no traffic is going through our proxy in regards to the above configuration. The exact configuration is working on Linux (Debian/RedHat).

File is download without going through proxy.

What behaviour did you expect instead

A CONNECT log event connecting to live.sysinternals.com that allowed the download and archiving of the SysinteralsSuite.zip file.

Any additional information you'd like to impart

If there are any more questions I am happy to provide extra information.

@alexjfisher
Copy link
Member

Can you try setting proxy_type => 'https'?

This line

self[:proxy_type] ||= URI(self[:proxy_server]).scheme.to_sym
looks buggy to me. It defaults proxy_type based on proxy_server instead of source.

@TeunRoefs
Copy link
Author

Hi Alex,

Thank you for the fast response.
Either using proxy_type => 'https' or proxy_type => 'http' has no effect on the outcome.

@nanliu
Copy link
Contributor

nanliu commented May 2, 2017

So on windows this uses the ruby provider, and per stdlib, it's suppose to honor the environment settings:

Net::HTTP will automatically create a proxy from the http_proxy environment variable if it is present. To disable use of http_proxy, pass nil for the proxy address.

Please add a few Puppet.debug lines to check and see:

  • is the environment var set correctly? (is it set correctly here)
  • does net::http honor this env var? (is still set correctly here)

This is most likely windows specific and we may need to switch to the explicit proxy declaration instead depending on the ENV var behavior.

@alexjfisher
Copy link
Member

Earlier today, I tried the ruby provider out on Linux and also observed the proxy settings didn't work. This was for an http url with an http proxy (no https anywhere). Not sure at what point the environment variable stopped working (I'm assuming it did work at some point!). I tried puppet 3 on ruby 2.1 and puppet 4 on 2.3 IIRC.

@TeunRoefs
Copy link
Author

What is the next step? Is there anything you want me to do in regards to this issue. Also, the remark was pointed at me @nanliu ?

@nanliu
Copy link
Contributor

nanliu commented May 6, 2017

@TeunRoefs, based on documentation, I replace ENV with specific flags in PR #280. I wanted to provide a quick test patch, so I didn't get a chance to test locally. Let me know if that fixes this issue.

@TeunRoefs
Copy link
Author

@nanliu Put a comment on your PR on the line that needs to be fixed. After changing the way the extra parameters are called in Net::HTTP.start() the Proxy server is working.

@TeunRoefs
Copy link
Author

@alexjfisher What is the release sequence of the puppet-archive module? Kinda need the functionality in PR #280 created by @nanliu Is there anything you guys want me to do?

@KZachariassen
Copy link

Tested - works fine. Could we get this merged to master please?

nanliu added a commit that referenced this issue Aug 2, 2017
Change how ruby proxy is invoked.
@nanliu
Copy link
Contributor

nanliu commented Sep 9, 2017

Closed per #280.

@nanliu nanliu closed this as completed Sep 9, 2017
cegeka-jenkins pushed a commit to cegeka/puppet-archive that referenced this issue Mar 26, 2021
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

4 participants