我正在尝试使用 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/