这显然是因为库没有使用 GSSAPI 支持构建;查看源代码(`libgasl-1.8.1'),唯一可以返回这个的地方是:
// src/xstart.c
static int
setup (Gsasl * ctx,
const char *mech,
Gsasl_session * sctx,
size_t n_mechs, Gsasl_mechanism * mechs, int clientp)
{
Gsasl_mechanism *mechptr = NULL;
int res;
mechptr = find_mechanism (mech, n_mechs, mechs);
if (mechptr == NULL)
return GSASL_UNKNOWN_MECHANISM;
所以这意味着它不是库支持它的情况,但它无法在计算机上找到支持它的资源(例如 kerberos)。
当我尝试在自己的系统上编译它时,configure 没有启用 GSSAPI,因为它找不到重要的东西:
...
checking if DIGEST-MD5 should be used... yes
checking if SCRAM-SHA-1 should be used... yes
checking if SAML20 should be used... yes
checking if OPENID20 should be used... yes
configure: checking for GSS implementation (yes)
configure: auto-detecting GSS/MIT/Heimdal
configure: use --with-gssapi-impl=IMPL to hard code
configure: where IMPL is `gss', `mit', or `heimdal'
checking for libgss... no
configure: WARNING: GNU GSS not found (see http://www.gnu.org/software/gss/)...
configure: WARNING: Auto-detecting MIT/Heimdal is unreliable, disabling GSSAPI
checking if KERBEROS_V5 should be used... no
...
因此要么缺少某些基础包,您需要获取相关但名称不同的包(包括此支持),或者您需要使用启用所需功能的选项自己构建它。