Skip to content

Commit baa6cf0

Browse files
committed
PYTHON-932 - Attribute err in GSSAPI / Kerberos
1 parent 056d1a0 commit baa6cf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymongo/auth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ def _authenticate_gssapi(credentials, sock_info):
241241
gsn = credentials.mechanism_properties.service_name
242242
# Starting here and continuing through the while loop below - establish
243243
# the security context. See RFC 4752, Section 3.1, first paragraph.
244+
host = sock_info.address[0]
244245
result, ctx = kerberos.authGSSClientInit(
245-
gsn + '@' + sock_info.host, gssflags=kerberos.GSS_C_MUTUAL_FLAG)
246+
gsn + '@' + host, gssflags=kerberos.GSS_C_MUTUAL_FLAG)
246247

247248
if result != kerberos.AUTH_GSS_COMPLETE:
248249
raise OperationFailure('Kerberos context failed to initialize.')

0 commit comments

Comments
 (0)