Box Api v2 SSL版本Python [英] Box Api v2 SSL Version Python

查看:106
本文介绍了Box Api v2 SSL版本Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试通过box.net api v2.0获取身份验证令牌时正在寻找有关SSL错误的信息.

Looking for some information regarding an SSL error while trying to get an auth token via box.net api v2.0.

我正在使用Python 2.7,OpenSSL 1.0.1c和 requests 库.

I'm using Python 2.7, OpenSSL 1.0.1c, and the requests library.

    payload = {"action":"get_auth_token", "api_key":self.box_apikey, "ticket":self.box_ticket['status'], "verify":False}
    r = requests.get(self.box_secure_endpoint+"rest", params=payload)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 65, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/safe_mode.py", line 39, in wrapped
    return function(method, url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 51, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 241, in request
    r.send(prefetch=prefetch)
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 641, in send
    raise SSLError(e)
requests.exceptions.SSLError: _ssl.c:316: Invalid SSL protocol variant specified.

注意:

  • 我也正在更深入地研究requests lib,以查看是否存在SSL ver request功能的解决方法.
  • 如果我没记错的话,那么SSL证书中的第二位应该表示SSL版本.
  • I'm also looking deeper into the requests lib to see if there is some sort of work around of SSL ver request feature.
  • If I'm not mistaken, the second bit in a SSL cert should indicate the SSL version.

推荐答案

此问题导致验证服务器ssl版本支持(明确性ssl.PROTOCOL_SSLv3 |

The issue lead to verifying server ssl version support (explicity ssl.PROTOCOL_SSLv3 | http://docs.python.org/2.7/library/ssl.html#ssl.wrap_socket).

我将把请求转发给lib dev或创建一个补丁以启用显式指定协议的功能.

I'm going to forward the request to the lib devs or create a patch to enable the functionality of explicitly specifying the protocol.

感谢您的帮助. :)

这篇关于Box Api v2 SSL版本Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆