我只使用http服務,我不想支付SSL證書並且不使用自簽名證書。還有其他方法可以在我的應用程序客戶端中獲取發送推送通知。提前致謝。如何發送沒有ssl證書的android推送通知
0
A
回答
0
查看鏈接。我希望它能幫助你。你應該禁用你的服務器SSL然後發送推送通知。使用下面的鏈接進行參考。 1)代碼爲客戶端2)添加此代碼的服務器。
1)http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/ 2)http://www.nakov.com/blog/2009/07/16/disable-certificate-validation-in-java-ssl-connections/
public static void main(String[] args) throws Exception {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[] {new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
};
// Install the all-trusting trust manager
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
// Create all-trusting host name verifier
HostnameVerifier allHostsValid = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
// Install the all-trusting host verifier
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
URL url = new URL("https://www.nakov.com:2083/");
URLConnection con = url.openConnection();
Reader reader = new InputStreamReader(con.getInputStream());
while (true) {
int ch = reader.read();
if (ch==-1) {
break;
}
System.out.print((char)ch);
}
}
+0
等待我只是指它。 – 2015-02-25 06:27:54
相關問題
- 1. 何時安裝分發推送通知證書(SSL證書)
- 2. Apple推送通知中的SSL證書
- 3. 推送通知Apple SSL證書x常規SSL證書
- 4. 開發證書的推送通知
- 5. 證書和推送通知
- 6. Apple推送通知證書
- 7. 推送通知證書
- 8. iOS推送通知分發證書
- 9. 發送帶有證書的Windows Phone推送通知?
- 10. 如何爲推送通知安裝ssl證書?
- 11. AWS SNS推送通知沒有發送
- 12. Cloudkit沒有發送推送通知
- 13. iOS - 推送通知SSL證書有效性
- 14. 使用PyFCM發送推送通知時'證書驗證失敗'
- 15. 通過node.js發送android推送通知
- 16. 1推送多個應用程序的通知SSL證書
- 17. 問題產生推送通知的SSL證書
- 18. 向iOS PushSharp證書發送推送通知
- 19. 如何發送沒有聲音的推送通知?
- 20. 蘋果推送通知servicce ssl證書過期了嗎?
- 21. 推送通知證書P12文件
- 22. Laravel推送通知:證書不存在
- 23. 推送通知證書問題
- 24. iOS推送通知.p12證書
- 25. 推送通知APNS證書用法:
- 26. iOS推送通知AuthenticationException證書
- 27. 推送通知證書籤名錯誤
- 28. 推送通知證書生成
- 29. 推送通知證書錯誤
- 30. Apple推送通知證書到期
:按我在機器人GCM關注用於推送通知,這是可能的,而不具有SSL證書。 – 2015-02-23 06:50:57
我嘗試GCM,但它給出錯誤消息。看我以前的帖子。 http://stackoverflow.com/questions/28647660/ssl-handshake-exception-in-android-gcm-server這裏是鏈接。 – 2015-02-23 06:54:17
如果你知道發送任何鏈接或示例代碼@Born贏得 – 2015-02-23 06:57:02