如何在构建libcurl时启用digest

How to enable digest when building libcurl

本文关键字:启用 digest libcurl 构建      更新时间:2023-10-16

我构建了libcurl并运行它,但当服务器需要摘要身份验证时,它不起作用。

我检查了C代码,发现以下部分(在output_auth_headers函数中的http.C中)没有构建:

#ifndef CURL_DISABLE_CRYPTO_AUTH
  if(authstatus->picked == CURLAUTH_DIGEST) {
    auth="Digest";
    result = Curl_output_digest(conn,
                                proxy,
                                (const unsigned char *)request,
                                (const unsigned char *)path);
    if(result)
      return result;
  }
  else
#endif

我应该怎么做才能使这部分代码构建,然后使摘要运行?

配置时,请确保选择--enable-crypto-auth

像这样:

./buildconf && ./configure --enable-crypto-auth