2016-03-02 56 views
0

我已经开始收到以下错误凌空权:SSLPeerUnverifiedException HTTPS请求,如果解析推压初始化

com.android.volley.NoConnectionError: javax.net.ssl.SSLPeerUnverifiedException: Cannot verify hostname: xxxxx.yy 

xxxxx.yy是我使用通信主机HTTPS。连接建立的方式非常平常。例如。这是一个调用函数:

public static void login(final String token, final Activity activity) { 
    String requestUrl = AppConstant.LOGIN; 

    final HashMap<String, String> params = new HashMap<String, String>(); 
    if (token != null && !token.isEmpty()) { 
     params.put("token", token); 
    } 
    params.put("useragent", AppConstant.USER_AGENT); 
    params.put("version", getVersionName(activity)); 

    JsonFormRequest myRequest = new JsonFormRequest(
      Request.Method.POST, 
      requestUrl, 
      params, 
      new Response.Listener<JSONObject>() { 
       @Override 
       public void onResponse(JSONObject jsonObject) { 
        ... 
       } 
      }, 
      new Response.ErrorListener() { 
       @Override 
       public void onErrorResponse(VolleyError volleyError) { 
        ... 
       } 
      } 
    ); 

    MfApplication.getInstance().addToRequestQueue(myRequest, "tag_login_phone"); 
} 

它增加了请求队列:

public <T> void addToRequestQueue(Request<T> req, String tag) { 
    getRequestQueue().add(req); 
} 

的队列为以下方式创建一次:

mRequestQueue = Volley.newRequestQueue(getApplicationContext()); 

如果我删除了以下解析初始化代码从我的应用程序类错误消失:

Parse.initialize(this); 
ParseInstallation.getCurrentInstallation().saveInBackground(); 
ParsePush.subscribeInBackground("general"); 

问题的原因是什么?可以做些什么?

回答

0

对于任何其他问题完全相同的人:将Android Parse SDK版本更新为1.13.1可解决此问题。