我的代碼:出現SSLHandshakeException與OAuth認證面臨
URL url=new URL(https url with client id and clientsecret);
HttpURLConnection connect=(HttpURLConnection) url.openConnection();
connect.setRequestMethod("POST");
connect.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
connect.setDoOutput(true);
通過這個我越來越
javax.net.ssl.SSLHandshakeException:無法驗證SSL證書 的URL:(我的網址)
如果試圖改變HttpsURLConnection
:
URL url=new URL(https url with client id and clientsecret);
HttpsURLConnection connect=(HttpsURLConnection) url.openConnection();
connect.setRequestMethod("POST");
connect.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
connect.setDoOutput(true);
我越來越
java.lang.ClassCastException: com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler $連接 不能轉換到javax.net.ssl.HttpsURLConnection中
我正在與GAE合作。我需要解決這個問題來獲取訪問令牌。 通過查看舊問題,我沒有得到正確的解決方案。
當m通過「curl」嘗試通過終端時,我能夠獲得有效的訪問令牌。
curl --data "parameters like client id and client secret and the auth_code" my https url
在此之後米能夠得到令牌
即使我嘗試了一些代碼,我發現在http://stackoverflow.com/questions/2893819/telling-java-to-accept-self-signed-ssl-certificate –
這是否發生在開發服務器上或者也在部署的應用程序? – Adam
我hv尚未在已部署的應用程序中添加此代碼。我只是在當地檢查。 –