title: gss_acquire_cred failing with No key table entry found
body: <p>I am trying to make a windows client authenticate with a Linux server in a domain-joined scenario, I have created a service principal based on the documentation provided as part of <a href="https://github.com/josephholsten/pbis/tree/master/gssapps/proxy/sspi-sample" rel="noreferrer">PBIS/gssapps</a> and <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa380496(v=vs.85).aspx]" rel="noreferrer">MSDN GSS/SSPI interop documentation</a>. Updated the relevant keytab entry in /etc/krb5.keytab.</p>
  
  <p>Ensured the DNS zones are set up correctly and the machine is domain joined </p>
  
  <pre><code>static int server_acquire_creds(
      char *service_name,
      gss_cred_id_t *server_creds
      ) 
  {
      int ret = 0;
      gss_buffer_desc name_buf = GSS_C_EMPTY_BUFFER;
      gss_name_t server_name = GSS_C_NO_NAME;
      OM_uint32 maj_stat = 0, min_stat = 0;
  
      name_buf.value = service_name;
      name_buf.length = strlen((char *)name_buf.value) + 1;
      maj_stat = gss_import_name(&amp;min_stat, &amp;name_buf,
                                 (gss_OID) gss_nt_service_name, &amp;server_name);
      if (maj_stat != GSS_S_COMPLETE) {
          display_status("importing name", maj_stat, min_stat);
          ret = -1;
          goto error;
      }
  
  
      maj_stat = gss_acquire_cred(&amp;min_stat, server_name, 0,
                                  GSS_C_NULL_OID_SET, GSS_C_ACCEPT,
                                  server_creds, NULL, NULL);
      if (maj_stat != GSS_S_COMPLETE) {
          display_status("acquiring credentials", maj_stat, min_stat);
          ret = -1;
          goto error;
      }
  
  error:
      (void) gss_release_name(&amp;min_stat, &amp;server_name);
  
      return ret;
  }
  </code></pre>
  
  <p>The error I am running into:</p>
  
  <pre><code>GSS-API error acquiring credentials: Unspecified GSS failure.  Minor code may provide more information (851968, 851968, 0x000d0000)
  
  GSS-API error acquiring credentials: No key table entry found matching gss\/dell-vostro-155.domain.in/domain.in@ (39756033, 39756033, 0x025ea101)
  </code></pre>
  
  <p>The <code>service_name</code> passed is <code>"gss/dell-vostro-155.domain.in@domain.in"</code>.</p>
  
  <p>I do see the principal in ktutil/list</p>
  
  <p>Mostly looking for advice on how to go about debugging this.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p><code>ktutil: list -e</code></p>
  
  <p><code>...</code></p>
  
  <p><code>114    2 gss/dell-vostro-155.domain.in@domain.in (des-cbc-crc)</code></p>
  
  <pre><code>~/work/gss$ hostname -A
  dell-vostro-155.domain.in 
  </code></pre>
  
  <p>This is happening on the server end, where it is going to do an gss_ASC, </p>
  
  <p><code>sudo ./gss-server gss/dell-vostro-155.domain.in@domain.in</code></p>
  
  <p>so gss-server is acting as the "gss" part in the principal name.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>krb5.conf is a bit big I wanted to paste things as it is so added a Pastebin link <a href="https://pastebin.com/AVjkLsJY" rel="noreferrer">krb5.conf</a></p>