ansible-go icon indicating copy to clipboard operation
ansible-go copied to clipboard

workaround failure of get_url on python 2.7.6 hosts

Open jonseymour opened this issue 8 years ago • 1 comments

This is an alternative resolution of #22 which would tolerate any specified URL, including those for older versions.

golang.org download URLs do not serve the correct TLS certificate unless TLS SNI is used. The TLS client in Python 2.7.6 doesn't support TLS SNI and so reports an certificate validation error.

Fortunately, the golang.org URL is actually a redirect to a different URL which does export the correct certificate even without SNI.

This change adjusts the specified download URL to take account of which version of python is installed on the host by fallowing the redirect with curl, defaulting to the original URL if this process does not work for some reason.

Signed-off-by: Jon Seymour [email protected]

jonseymour avatar Mar 18 '16 23:03 jonseymour

@jlund I see you fixed the issue by manually following the redirect which is probably reasonable. I developed this before I saw your changes and offer it for your contemplation, but I think your solution solves the problem neatly too, so happy for you to close this without merging if you desire.

jonseymour avatar Mar 18 '16 23:03 jonseymour