fcm与自证书颁发

gg58donl  于 2021-07-07  发布在  Java
关注(0)|答案(0)|浏览(433)

我使用fcm发送通知,我的代码在使用http时运行良好。问题发生在我使用自证书启用ssl时,我无法从fcm上的主题调用subscribe/unsubscribe,出现错误 internal-error 代码。
你知道这个问题吗?请帮忙
我正在尝试调试,以便可以获取访问令牌,但无法调用sub/unsubscribe

2020-12-02T16:06:24.192Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http.HttpTransport|curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'User-Agent: Google-HTTP-Java-Client/1.35.0 (gzip)' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -d '@-' -- 'https://oauth2.googleapis.com/token'  << $$$
2020-12-02T16:06:24.320Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http.HttpTransport|Total: 1,123 bytes
2020-12-02T16:06:24.321Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http.HttpTransport|grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eyJhbGciOiJSUzI1NiIsImtpZCI6Ijk4NWUyNWI4ODc0ZDkwMDg4NWJjZWJiZWNmMzg2MjVkMTRmYTNhMWUiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJodHRwczovL29hdXRoMi5nb29nbGVhcGlzLmNvbS90b2tlbiIsImV4cCI6MTYwNjkyODc4NCwiaWF0IjoxNjA2OTI1MTg0LCJpc3MiOiJmaXJlYmFzZS1hZG1pbnNkay03bnZvaEBhc2NlbmQtZGV2LXRlc3QuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzY29wZSI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvZmlyZWJhc2UuZGF0YWJhc2UgaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC91c2VyaW5mby5lbWFpbCBodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRoL2lkZW50aXR5dG9vbGtpdCBodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRoL2RldnN0b3JhZ2UuZnVsbF9jb250cm9sIGh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvY2xvdWQtcGxhdGZvcm0gaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9kYXRhc3RvcmUifQ.jnqKQhzxSkSvX5aKumAN1sJPk07l-IWYfCVi5O_Pxh4SQ0-mSrBEdtUXIXKilECB6Mdhg7dMu4zjewUHaFFLfqT6JYnZkAX3ByjKxjW6IP0RdclxV_cN8H-RRmgQkIdm5NX5OgfvGMZskU-Pwoly5QRVoppnJfr5tndbBCkXdB1FTdzcQr61yAnzGfb9b4NDXFeLrftQzMs2psRxtswIluryjOt_uZoaxyc0NRU3iVc28pKIuGH5z6wAQMfVUtySyec0jdgzPMA2ppGL6Jp8ZwVL7tpbPeKZvWfHgeAVVoFUgCqn8bdvmJ0skGKJjZrkzpjNcDhMJLcM78ZPRmsU_A
2020-12-02T16:06:24.358Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http.HttpTransport|-------------- RESPONSE --------------
HTTP/1.1 200 OK

这是调用subscribe时的日志

2020-12-02T16:06:24.394Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http.HttpTransport|-------------- REQUEST  --------------
POST https://iid.googleapis.com/iid/v1:batchAdd 
Accept-Encoding: gzip
Authorization: <Not Logged>
User-Agent: Google-HTTP-Java-Client/1.35.0 (gzip)
access_token_auth: true
Content-Type: application/json; charset=UTF-8
Content-Length: 217

2020-12-02T16:06:24.394Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http.HttpTransport|curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: <Not Logged>' -H 'User-Agent: Google-HTTP-Java-Client/1.35.0 (gzip)' -H 'access_token_auth: true' -H 'Content-Type: application/json; charset=UTF-8' -d '@-' -- 'https://iid.googleapis.com/iid/v1:batchAdd'  << $$$
2020-12-02T16:06:24.455Z|2|ERROR|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|c.a.a.fcm-demo.client.FirebaseClient|Subscribe to topic [topic-0019] - failed with error code [UNKNOWN], messaging error code [null], message [Unknown error while making a remote service call: Connection reset]

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题