1. <i id='djigT'><tr id='djigT'><dt id='djigT'><q id='djigT'><span id='djigT'><b id='djigT'><form id='djigT'><ins id='djigT'></ins><ul id='djigT'></ul><sub id='djigT'></sub></form><legend id='djigT'></legend><bdo id='djigT'><pre id='djigT'><center id='djigT'></center></pre></bdo></b><th id='djigT'></th></span></q></dt></tr></i><div id='djigT'><tfoot id='djigT'></tfoot><dl id='djigT'><fieldset id='djigT'></fieldset></dl></div>
      <legend id='djigT'><style id='djigT'><dir id='djigT'><q id='djigT'></q></dir></style></legend>

      <tfoot id='djigT'></tfoot>

      <small id='djigT'></small><noframes id='djigT'>

          <bdo id='djigT'></bdo><ul id='djigT'></ul>

        请求:cert 和 verify 有什么区别?

        Requests: what is the difference between cert and verify?(请求:cert 和 verify 有什么区别?)
        <legend id='SUyvX'><style id='SUyvX'><dir id='SUyvX'><q id='SUyvX'></q></dir></style></legend>

      1. <small id='SUyvX'></small><noframes id='SUyvX'>

            <i id='SUyvX'><tr id='SUyvX'><dt id='SUyvX'><q id='SUyvX'><span id='SUyvX'><b id='SUyvX'><form id='SUyvX'><ins id='SUyvX'></ins><ul id='SUyvX'></ul><sub id='SUyvX'></sub></form><legend id='SUyvX'></legend><bdo id='SUyvX'><pre id='SUyvX'><center id='SUyvX'></center></pre></bdo></b><th id='SUyvX'></th></span></q></dt></tr></i><div id='SUyvX'><tfoot id='SUyvX'></tfoot><dl id='SUyvX'><fieldset id='SUyvX'></fieldset></dl></div>
            <tfoot id='SUyvX'></tfoot>

              <tbody id='SUyvX'></tbody>
              • <bdo id='SUyvX'></bdo><ul id='SUyvX'></ul>
                  本文介绍了请求:cert 和 verify 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  cert 和 verify 有什么区别?

                  What is the difference between cert and verify?

                  来自文档:

                  verify –(可选)如果为 True,将验证 SSL 证书.还可以提供 CA_BUNDLE 路径.cert –(可选)如果是字符串,则为 ssl 客户端证书文件 (.pem) 的路径.如果是 Tuple,则为 (‘cert’, ‘key’) 对.

                  verify – (optional) if True, the SSL cert will be verified. A CA_BUNDLE path can also be provided. cert – (optional) if String, path to ssl client cert file (.pem). If Tuple, (‘cert’, ‘key’) pair.

                  这是否意味着我可以做到以下几点:

                  Does this mean I can do the following:

                  CA_BUNDLE='path/to/.pem'
                  requests.get(url=google.com, verify= CA_BUNDLE)
                  

                  Cert='path/to/.pem'
                  requests.get(url=google.com, cert=Cert)
                  

                  他们看起来都在做同样的事情.除了 verify 可以禁用 ssl 验证.

                  They both look like they do the same thing. except verify can disable ssl verification.

                  我正在尝试使用 PYinstaller 将我的代码编译为 exe.我正在使用我看到已经有一个 cacert.pem 文件的 certifi 模块,但我想我仍然必须将它与我的代码捆绑在一起.

                  I am trying to compile my code to an exe using PYinstaller. I am using certifi module that I see already has a cacert.pem file but I guess I still have to bundle it with my code.

                  在我的代码中,我是修改 ...verify 还是 cert?...使用 cacert.pem 的路径还是只是 'cacert.pem'?

                  In my code do I modify ...verify or cert?...with a path to cacert.pem or just 'cacert.pem'?

                  推荐答案

                  我觉得文档里写的很清楚:http://www.python-requests.org/en/latest/user/advanced/#ssl-cert-verification

                  I think it is clearly stated in the documentation: http://www.python-requests.org/en/latest/user/advanced/#ssl-cert-verification

                  cert 选项是向您发送自己的证书,例如使用客户端证书对服务器进行身份验证.它需要一个证书文件,如果密钥与证书不在同一个文件中,则还需要密钥文件.

                  The option cert is to send you own certificate, e.g. authenticate yourself against the server using a client certificate. It needs a certificate file and if the key is not in the same file as the certificate also the key file.

                  verify 选项用于启用(默认)或禁用服务器证书的验证.它可以采用 True 或 False 或包含受信任 CA 的文件的名称.如果没有给出我认为(没有记录?)它将采用来自 OpenSSL 的默认 CA 路径/文件,该路径通常适用于 UNIX(可能除了 OS X)而不适用于 Windows.

                  The option verify is used to enable (default) or disable verification of the servers certificate. It can take True or False or a name of a file which contains the trusted CAs. If not given I think (not documented?) it will take the default CA path/file from OpenSSL, which works usually on UNIX (except maybe OS X) and not on windows.

                  这篇关于请求:cert 和 verify 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What happens when you compare 2 pandas Series(当你比较 2 个 pandas 系列时会发生什么)
                  Quickly find differences between two large text files(快速查找两个大文本文件之间的差异)
                  Python - Compare 2 files and output differences(Python - 比较 2 个文件和输出差异)
                  Why do comparisions between very large float values fail in python?(为什么在 python 中非常大的浮点值之间的比较会失败?)
                  Dictionary merge by updating but not overwriting if value exists(字典通过更新合并,但如果值存在则不覆盖)
                  Find entries of one text file in another file in python(在python中的另一个文件中查找一个文本文件的条目)

                    <i id='SMqRz'><tr id='SMqRz'><dt id='SMqRz'><q id='SMqRz'><span id='SMqRz'><b id='SMqRz'><form id='SMqRz'><ins id='SMqRz'></ins><ul id='SMqRz'></ul><sub id='SMqRz'></sub></form><legend id='SMqRz'></legend><bdo id='SMqRz'><pre id='SMqRz'><center id='SMqRz'></center></pre></bdo></b><th id='SMqRz'></th></span></q></dt></tr></i><div id='SMqRz'><tfoot id='SMqRz'></tfoot><dl id='SMqRz'><fieldset id='SMqRz'></fieldset></dl></div>
                  • <legend id='SMqRz'><style id='SMqRz'><dir id='SMqRz'><q id='SMqRz'></q></dir></style></legend>

                        <bdo id='SMqRz'></bdo><ul id='SMqRz'></ul>
                          <tbody id='SMqRz'></tbody>
                        <tfoot id='SMqRz'></tfoot>

                        <small id='SMqRz'></small><noframes id='SMqRz'>