Android sslpeerunverifiedexception no peer certificate, JSON SSL -


I across the web and read a lot about most stack overflow .. I still can not get your code works correctly. .I am still getting: Android Sselpirnurupisteddharn not peer certificate

this is my code, and if someone can help me if I I would be grateful:

  Public class increases main activity activity (ArrayList & lt; string & gt; nameArrayList = New Arrelist & lt; String & gt; (); ArrayList & LT; string & gt; Deshareel = new Arresuchi & lt; String & gt; (); string Kbruarel = "https://example.com/grave.json "protected void onCreate (Bundle saved Instansstet) {super.onCreate (SavedInstanceState); setContentView (R.layout.activity_main); new Jason (). execute ();} Class Jason Async Task & lt; zero, zero, String & Sec.> Secure on SecurexXSite () {Super .Print ();} Protected String doInBackground (Zero ... Parameter) {Http Client httpclient = createHttpClient (); Http post httppost = new HTTP post (web url); Try {HttpResponse response = httpclient.execute (httppost); Threaded Positions = Response .getStatusLine (); Int statusCode = statusLine.getStatusCode (); If (statusCode! = 200) {return tap; } InputStream jsonstream = response.getEntity () GetContent (); BufferedReader Reader = New BufferedReader (New InputStreamReader (jsonstream)); Stringbuilder builder = new stringbiller (); String line; While ((line = reader.readline ()) = null) {builder.append (line); } String json.data = builder.toString (); JSONObject json = New JSONObject (jsonData); JSONArray name = json.getJSONArray ("grave"); For (int i = 0; i & lt; name.length (); i ++) {JSONObject video = name.getJSONObject (i); NameArrayList.add (video.getString ("ID_line")); CountryArrayList.add (video.getString ("ID_grave")); }} Catch (Client Protocol E) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); } Hold (JasonX Express E) {e.printStackTrace (); } Return tap; } Protected void onPostExecute (string result) {super.onPostExecute (results); Toast. MakeApplicationContext (), "Hello" + NameArrelistGate (0) .string (), Toast.LNNHHLog) Show (); }} HTTP Client (HTTP Parameters Parameters = New Basic HTTPPARM); Creating Public Static HTTP Client Http protocols.Setverson (param, http version.httip_1_1); HttpProtocolParams.setContentCharset (Parameters, HTTP. DEFAULT_CONTENT_CHARSET); HttpProtocolParams.setUseExpectContinue (Param, True); Schmidt Schreg = New Planet (); SchReg.register (New Plan ("http", Plane SocketFactory .getSocketFactory (), 80)); SchReg.register (new plan ("https", SSLSocketFactory.getSocketFactory (), 443)); ClientConcondonManager conMgr = New ThreadSaffeclitConnamAnger (Params, SARF); Return a new default HTTP client (Conram, Parameters); }}   

Most of the code can not I stack got overflow, but it seems that I have the pieces together that it works correctly ..

Thx

the use of this server untrusted certificate, except you SSL socket of your own Bypassing it by creating a factory, or by adding a certificate to your device.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -