perl - 使用 Net::Google::Spreadsheets 在 Google Spreadsheet API 上登录失败

标签 perl google-spreadsheet-api

我正在尝试使用 Net::Google::Spreadsheets 读出(稍后甚至可能写入)Google 电子表格。

最样板脚本死于“登录失败”并且没有错误:

use Net::Google::Spreadsheets;

my $service = Net::Google::Spreadsheets->new(
  username => 'myusername@googlemail.com',
  password => 'mypassword'
);

我得到的只是

Net::Google::AuthSub login failed

遗憾的是,我不知道如何诊断或解决这个问题。有人吗?

非常感谢!

最佳答案

可能是因为 SSL 证书检查。您可以跳过测试:

$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

尽管您确实应该根据 Net::Google::AuthSub 模块返回的消息正确设置证书颁发机构:

Can't verify SSL peers without knowing which Certificate Authorities to trust

This problem can be fixed by either setting the PERL_LWP_SSL_CA_FILE envirionment variable or by installing the Mozilla::CA module.

To disable verification of SSL peers set the PERL_LWP_SSL_VERIFY_HOSTNAME envirionment variable to 0. If you do this you can't be sure that you communicate with the expected peer.

关于perl - 使用 Net::Google::Spreadsheets 在 Google Spreadsheet API 上登录失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18790570/

相关文章:

perl - 在运行时以编程方式创建 Moose 类

xml - 通过 apache 检查 Perl 使用了哪些核心可加载模块?

firebase - 在对象 [object Object] 中找不到函数 FirebaseApp.getDatabaseByUrl

c++ - 在 longjmp/croak 之前显式调用析构函数

perl - 如何获取其键与给定正则表达式匹配的哈希元素?

excel - Excel 可以从 Google Drive Excel 电子表格中检索数据吗?

android - 如何更新/写入数据到谷歌电子表格 api android (api v4)

api - 使用 Google 电子表格 API 可以发出的最大请求数是多少?

Perl:GD:SecurityImage,角度属性不起作用

charts - 谷歌电子表格图表中的命名范围?