使用GDriveFS挂载Google Drive出现SSL错误解决

1,684次阅读
没有评论

共计 1519 个字符,预计需要花费 4 分钟才能阅读完成。

安装正常流程操作,然后获取到 Google Drive 的授权码,使用命令填入授权码

gdfstool auth -a /var/cache/gdfs.creds "你的授权码"

出现如下错误

Traceback (most recent call last):
  File "/usr/bin/gdfstool", line 125, in <module>
    main()
  File "/usr/bin/gdfstool", line 118, in main
    _handle_auth(args)
  File "/usr/bin/gdfstool", line 56, in _handle_auth
    _handle_auth_store(*args.auth)
  File "/usr/bin/gdfstool", line 50, in _handle_auth_store
    authorize.step2_doexchange(authcode)
  File "/usr/lib/python2.7/site-packages/gdrivefs/gdtool/oauth_authorize.py", line 143, in step2_doexchange
    raise AuthorizationFailureError(message)
gdrivefs.errors.AuthorizationFailureError: Could not do auth-exchange (this was either a legitimate error, or the auth-exchange was attempted when not necessary): [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)

使用命令查询 pip 列表各版本

pip list
使用 GDriveFS 挂载 Google Drive 出现 SSL 错误解决

查询可知 httplib2 版本为 0.8,使用命令升级 httplib2

pip install --upgrade httplib2
使用 GDriveFS 挂载 Google Drive 出现 SSL 错误解决

再次填入授权码命令即可,成功输出如下

Authorization code recorded.

授权码好像有一定时效,过期将输出如下错误

Traceback (most recent call last):
  File "/usr/bin/gdfstool", line 125, in <module>
    main()
  File "/usr/bin/gdfstool", line 118, in main
    _handle_auth(args)
  File "/usr/bin/gdfstool", line 56, in _handle_auth
    _handle_auth_store(*args.auth)
  File "/usr/bin/gdfstool", line 50, in _handle_auth_store
    authorize.step2_doexchange(authcode)
  File "/usr/lib/python2.7/site-packages/gdrivefs/gdtool/oauth_authorize.py", line 143, in step2_doexchange
    raise AuthorizationFailureError(message)
gdrivefs.errors.AuthorizationFailureError: Could not do auth-exchange (this was either a legitimate error, or the auth-exchange was attempted when not necessary): invalid_grant

遇到如上情况,重新输入如下命令认真 Google Drive 接口授权认证即可

gdfstool auth -u

正文完
 
Hlynford
版权声明:本站原创文章,由 Hlynford 2018-07-29发表,共计1519字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)