android GCM服务错误500

时间:2013-09-22 15:39:05

标签: android google-cloud-messaging

在尝试通过GCM将我的消息从我的服务器发布到Android手机时

收到以下错误:

{"collapse_key":"update","registration_ids":["the reg I got from the phone"],"delay_while_idle":true,"data":{"info":"data_changed"}}, response is: $VAR1 = bless( {
                 '_content' => 'Can\'t connect to android.googleapis.com:443 (Network is unreachable)

LWP::Protocol::https::Socket: connect: Network is unreachable at /usr/local/share/perl5/LWP/Protocol/http.pm line 51.
',
                 '_rc' => 500,
                 '_headers' => bless( {
                                        'client-warning' => 'Internal response',
                                        'client-date' => 'Sun, 22 Sep 2013 18:23:10 GMT',
                                        'content-type' => 'text/plain',
                                        '::std_case' => {
                                                          'client-warning' => 'Client-Warning',
                                                          'client-date' => 'Client-Date'
                                                        }
                                      }, 'HTTP::Headers' ),
                 '_msg' => 'Can\'t connect to android.googleapis.com:443 (Network is unreachable)',
                 '_request' => bless( {
                                        '_content' => '{"collapse_key":"update","registration_ids":["the reg I got from the phone"],"delay_while_idle":true,"data":{"info":"data_changed"}}',
                                        '_uri' => bless( do{\(my $o = 'https://android.googleapis.com/gcm/send')}, 'URI::https' ),
                                        '_headers' => bless( {
                                                               'user-agent' => 'libwww-perl/6.05',
                                                               'content-type' => 'application/json; charset=UTF-8',
                                                               'content-length' => 266,
                                                               'authorization' => 'key=my api key'
                                                             }, 'HTTP::Headers' ),
                                        '_method' => 'POST'
                                      }, 'HTTP::Request' )
               }, 'HTTP::Response' );

我一直在尝试不同的东西,但无法让它发挥作用 我在我的服务器端使用perl,但这不会影响这个问题,因为这是一个简单的http post请求,似乎不起作用

有人知道为什么会这样吗?

1 个答案:

答案 0 :(得分:0)

我想我会更新这个问题所以不会没有答案

问题是我忘了为用户代理定义“ ssl_opts ”参数,

表示https验证未正确完成

现在它正常工作:)