<h5 dir="auto">Issue Type</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version</h5>
<p dir="auto">2.0.0  (devel <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/132c14eb57c56a05e65db7c86a609fd3a94b49f9/hovercard" href="https://github.com/ansible/ansible/commit/132c14eb57c56a05e65db7c86a609fd3a94b49f9"><tt>132c14e</tt></a>)</p>
<h5 dir="auto">OS</h5>
<p dir="auto">OSX Yosemite (tested module file with pyenv against 2.7.8/2.7.9/2.7.10)</p>
<h5 dir="auto">Summary</h5>
<p dir="auto">I've just encountered an issue with get_url on Github URLs, which are failing to verify certificates for some versions of Python. I'm fairly sure it's a manifestation of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="33269916" data-permission-text="Title is private" data-url="https://github.com/urllib3/urllib3/issues/385" data-hovercard-type="pull_request" data-hovercard-url="/urllib3/urllib3/pull/385/hovercard" href="https://github.com/urllib3/urllib3/pull/385">urllib3/urllib3#385</a>, which describes potentially breaking changes to <code class="notranslate">._tunnel()</code> in Python 3.4.1, backported to Python 2.7.9+. This logic seems to be identical to the <code class="notranslate">connect</code> method in <code class="notranslate">lib/ansible/module_utils/urls.py</code>, and behaves similarly -- the error I'm encountering is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="hostname 'webproxy.uhnres.utoronto.ca' doesn't match either of 'github.com', 'www.github.com'"><pre class="notranslate"><code class="notranslate">hostname 'webproxy.uhnres.utoronto.ca' doesn't match either of 'github.com', 'www.github.com'
</code></pre></div>
<p dir="auto">The same URL can be requested just fine through browsers and <code class="notranslate">curl</code>, so it seems to be a Python-specific (and version-specific, it does not affect Python 2.7.8) certificate verification issue with proxies.</p>
<p dir="auto">I think the modified logic in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="33269916" data-permission-text="Title is private" data-url="https://github.com/urllib3/urllib3/issues/385" data-hovercard-type="pull_request" data-hovercard-url="/urllib3/urllib3/pull/385/hovercard?comment_id=42783515&amp;comment_type=issue_comment" href="https://github.com/urllib3/urllib3/pull/385#issuecomment-42783515">urllib3/urllib3#385 (comment)</a> needs to be rolled into the <code class="notranslate">connect</code> method, so that <code class="notranslate">self._tunnel_host</code> is used in place of <code class="notranslate">self.host</code> if needed.</p>
<p dir="auto">This is deep into the guts of various systems, and I'm not a Python person, but I'll make a PR if you want me to.</p>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">This task should do it, if you have a proxy. All that matters is HTTPS + Github + Python 2/7/9+</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Webapp | Get release files
  get_url:
    url: &quot;https://github.com/pughlab/tracker/releases/download/2.0.1-RC4/tracker-java-restlet-2.0.1-RC4.war&quot;
    dest: &quot;output.war&quot;"><pre class="notranslate"><code class="notranslate">- name: Webapp | Get release files
  get_url:
    url: "https://github.com/pughlab/tracker/releases/download/2.0.1-RC4/tracker-java-restlet-2.0.1-RC4.war"
    dest: "output.war"
</code></pre></div>
<h5 dir="auto">Expected Results</h5>
<p dir="auto">Successful download</p>
<h5 dir="auto">Actual Results</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{&quot;msg&quot;: &quot;hostname 'webproxy.uhnres.utoronto.ca' doesn't match either of 'github.com', 'www.github.com'&quot;, &quot;failed&quot;: true}"><pre class="notranslate"><code class="notranslate">{"msg": "hostname 'webproxy.uhnres.utoronto.ca' doesn't match either of 'github.com', 'www.github.com'", "failed": true}
</code></pre></div>
<p dir="auto">when i use the hoc cmd ' ansible test1 -m yum -u root -a "name=httpd state=installed" -k  '<br>
An error occurred :<br>
"failed": true,<br>
"msg": "Traceback (most recent call last):\n  File "/root/.ansible/tmp/ansible-tmp-1407466908.63-106687021723210/yum", line 27, in \n    import yum\nImportError: No module named yum\n",<br>
"parsed": false<br>
}</p>
<p dir="auto">but i can user yum cmd in the client machine。how can i fix it ?</p>