From baa6cf0fd8563df2b4af4705ed2ba812be6109ec Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Mon, 18 May 2015 13:24:37 -0400 Subject: [PATCH] PYTHON-932 - Attribute err in GSSAPI / Kerberos --- pymongo/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymongo/auth.py b/pymongo/auth.py index 77dd14227..1b16c0155 100644 --- a/pymongo/auth.py +++ b/pymongo/auth.py @@ -241,8 +241,9 @@ def _authenticate_gssapi(credentials, sock_info): gsn = credentials.mechanism_properties.service_name # Starting here and continuing through the while loop below - establish # the security context. See RFC 4752, Section 3.1, first paragraph. + host = sock_info.address[0] result, ctx = kerberos.authGSSClientInit( - gsn + '@' + sock_info.host, gssflags=kerberos.GSS_C_MUTUAL_FLAG) + gsn + '@' + host, gssflags=kerberos.GSS_C_MUTUAL_FLAG) if result != kerberos.AUTH_GSS_COMPLETE: raise OperationFailure('Kerberos context failed to initialize.')