gpt4 book ai didi

python - pysvn.Client.callback_ssl_server_trust_prompt 错误

转载 作者:太空狗 更新时间:2023-10-30 02:06:16 24 4
gpt4 key购买 nike

我在尝试提交时收到 pysvn.Client.callback_ssl_server_trust_prompt required 错误。我知道这与互联网验证的信任有关。

这是文档,我只是不明白。

pysvn.Client.callback_ssl_server_trust_prompt

import pysvn

def ssl_server_trust_prompt( trust_dict ):
return retcode, accepted_failures, save

client = pysvn.Client()
client.callback_ssl_server_trust_prompt = ssl_server_trust_prompt

The callback_ssl_server_trust_promptis called each time an HTTPS serverpresents a certificate and subversionis not sure if it should be trusted.callback_ssl_server_trust_prompt iscalled with information about thecertificate in trust dict.

failures - int - a bitmask of failures

  • [What do these bits mean?] hostname - string - the hostname the certificate was presented fromfinger_print - string - certificatefinger print valid_from - string -valid from this ISO8601 datevalid_until - string - valid util thisISO8601 date issuer_dname - stirng -the issued dname realm - string - therealm pysvn expect thecallback_ssl_server_trust_prompt toreturn a tuple of three values(retcode, accepted_failures, save).

retcode - boolean, False if nousername and password are available.True if subversion is to use theusername and password.accepted_failures - int, the acceptedfailures allowed save - boolean,return True if you want subversion toremember the certificate in theconfiguration directory. return Falseto prevent saving the certificate.

最佳答案

当 pysvn 尝试对您使用 https 访问的存储库执行操作时,它需要验证服务器身份。这是通过调用一个名为 callback_ssl_server_trust_prompt 的函数来完成的。默认情况下,此函数未定义。作为程序员,您必须提供信任信息,您可以通过编写一个函数来查看信任字典中的信息,并返回一个包含 3 个值的元组(在文档的第三段中描述)。

编写函数后,通过将函数名称分配给 client.callback_ssl_server_trust_prompt 使其成为 callback_ssl_server_trust_prompt

关于python - pysvn.Client.callback_ssl_server_trust_prompt 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4893218/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com