fix GSSAPI authentication
This commit is contained in:
parent
549511d2e5
commit
08bb703640
2 changed files with 8 additions and 7 deletions
|
@ -158,7 +158,7 @@ class SASL(PlugIn):
|
||||||
if 'GSSAPI' in self.mecs and have_kerberos:
|
if 'GSSAPI' in self.mecs and have_kerberos:
|
||||||
self.mecs.remove('GSSAPI')
|
self.mecs.remove('GSSAPI')
|
||||||
self.gss_vc = kerberos.authGSSClientInit('xmpp@' + \
|
self.gss_vc = kerberos.authGSSClientInit('xmpp@' + \
|
||||||
self._owner.socket._hostfqdn)[1]
|
self._owner.xmpp_hostname)[1]
|
||||||
kerberos.authGSSClientStep(self.gss_vc, '')
|
kerberos.authGSSClientStep(self.gss_vc, '')
|
||||||
response = kerberos.authGSSClientResponse(self.gss_vc)
|
response = kerberos.authGSSClientResponse(self.gss_vc)
|
||||||
node=Node('auth',attrs={'xmlns': NS_SASL, 'mechanism': 'GSSAPI'},
|
node=Node('auth',attrs={'xmlns': NS_SASL, 'mechanism': 'GSSAPI'},
|
||||||
|
|
|
@ -49,6 +49,7 @@ class NonBlockingClient:
|
||||||
self.disconnect_handlers = []
|
self.disconnect_handlers = []
|
||||||
|
|
||||||
self.Server = domain
|
self.Server = domain
|
||||||
|
self.xmpp_hostname = None # FQDN hostname to connect to
|
||||||
|
|
||||||
# caller is who initiated this client, it is ineeded to register the EventDispatcher
|
# caller is who initiated this client, it is ineeded to register the EventDispatcher
|
||||||
self._caller = caller
|
self._caller = caller
|
||||||
|
@ -154,15 +155,15 @@ class NonBlockingClient:
|
||||||
self.proxy = proxy
|
self.proxy = proxy
|
||||||
|
|
||||||
if hostname:
|
if hostname:
|
||||||
xmpp_hostname = hostname
|
self.xmpp_hostname = hostname
|
||||||
else:
|
else:
|
||||||
xmpp_hostname = self.Server
|
self.xmpp_hostname = self.Server
|
||||||
|
|
||||||
estabilish_tls = self.secure == 'ssl'
|
estabilish_tls = self.secure == 'ssl'
|
||||||
certs = (self.cacerts, self.mycerts)
|
certs = (self.cacerts, self.mycerts)
|
||||||
|
|
||||||
proxy_dict = {}
|
proxy_dict = {}
|
||||||
tcp_host=xmpp_hostname
|
tcp_host = self.xmpp_hostname
|
||||||
tcp_port = self.Port
|
tcp_port = self.Port
|
||||||
|
|
||||||
if proxy:
|
if proxy:
|
||||||
|
@ -182,7 +183,7 @@ class NonBlockingClient:
|
||||||
estabilish_tls = estabilish_tls,
|
estabilish_tls = estabilish_tls,
|
||||||
certs = certs,
|
certs = certs,
|
||||||
proxy_creds = (proxy_user, proxy_pass),
|
proxy_creds = (proxy_user, proxy_pass),
|
||||||
xmpp_server = (xmpp_hostname, self.Port),
|
xmpp_server = (self.xmpp_hostname, self.Port),
|
||||||
domain = self.Server,
|
domain = self.Server,
|
||||||
bosh_dict = proxy)
|
bosh_dict = proxy)
|
||||||
self.protocol_type = 'BOSH'
|
self.protocol_type = 'BOSH'
|
||||||
|
@ -190,7 +191,7 @@ class NonBlockingClient:
|
||||||
|
|
||||||
else:
|
else:
|
||||||
proxy_dict['type'] = proxy['type']
|
proxy_dict['type'] = proxy['type']
|
||||||
proxy_dict['xmpp_server'] = (xmpp_hostname, self.Port)
|
proxy_dict['xmpp_server'] = (self.xmpp_hostname, self.Port)
|
||||||
proxy_dict['credentials'] = (proxy_user, proxy_pass)
|
proxy_dict['credentials'] = (proxy_user, proxy_pass)
|
||||||
|
|
||||||
if not proxy or proxy['type'] != 'bosh':
|
if not proxy or proxy['type'] != 'bosh':
|
||||||
|
|
Loading…
Add table
Reference in a new issue