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

安装正常流程操作,然后获取到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

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

pip install --upgrade httplib2

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

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
本文链接:https://hlynford.com/142.html
如未声明,均为作者Hlynford原创,转载请注明出处,谢谢
THE END
分享
二维码
< <上一篇
下一篇>>