mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Set the client auth callback after creating the SSL connection.
If we set the callback before calling connect() then if the connection tries a network family type and fails, it will try other family types. If this happens then the callback set on the first socket will be lost when a new socket is created. There is no way to query for the callback in an existing socket. https://fedorahosted.org/freeipa/ticket/1349
This commit is contained in:
parent
3894a4f13d
commit
6ad7deb7ac
@ -80,11 +80,11 @@ def https_request(host, port, url, secdir, password, nickname, **kw):
|
|||||||
"Accept": "text/plain"}
|
"Accept": "text/plain"}
|
||||||
try:
|
try:
|
||||||
conn = nsslib.NSSConnection(host, port, dbdir=secdir)
|
conn = nsslib.NSSConnection(host, port, dbdir=secdir)
|
||||||
|
conn.set_debuglevel(0)
|
||||||
|
conn.connect()
|
||||||
conn.sock.set_client_auth_data_callback(nsslib.client_auth_data_callback,
|
conn.sock.set_client_auth_data_callback(nsslib.client_auth_data_callback,
|
||||||
nickname,
|
nickname,
|
||||||
password, nss.get_default_certdb())
|
password, nss.get_default_certdb())
|
||||||
conn.set_debuglevel(0)
|
|
||||||
conn.connect()
|
|
||||||
conn.request("POST", url, post, request_headers)
|
conn.request("POST", url, post, request_headers)
|
||||||
|
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
|
Loading…
Reference in New Issue
Block a user