-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fixes an issue when using vault with HTTPS (tls 1.2) #3
Conversation
Had to wrap curl because the python version shipped with ansible doesn't support ssl.PROTOCOL_TLSv1_2
@jhaals can you take a look at this please ? :) |
Rather than calling out to curl why not use pycurl? For example: request_url = urljoin(url, "v1/%s" % (key))
buffer = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, request_url)
c.setopt(c.HTTPHEADER, ['X-Vault-Token: ' + token])
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()
result = json.loads(buffer.getvalue()) |
@cheekyhalf because i think adding another dependency is not a good idea |
I'm not sure this is the right thing to do. |
@jhaals on OSX it is... and i checked the python docs i see that it's supported since 2.7.9. But that would still not work on the version that is installed on OSX. This solution will work cross platform. |
@jhaals but now there is still an issue with the plugin, the problem is not solved yet. |
I'm running Python 2.7.11 on OS X and I don't see the problem there. |
@jhaals did you test with vault running on HTTPS with a certificate and the following modification (to use the proper TLS version):
|
I run vault over HTTPS just supporting TLS 1.2 |
Had to wrap curl because the python version shipped with ansible doesn't support ssl.PROTOCOL_TLSv1_2