http - javax.net.ssl.SSLException: hostname in certificate didn't match android -
i creating android app in sending data web service getting error of javax.net.ssl.sslexception: hostname in certificate didn't match android here code
asynchttpclient clien= new asynchttpclient(); log.i("url", string.valueof(base_url+"race.svc/json/race/scanners/add/"+series_event_raceid+"/"+qrcode)); clien.put(base_url+"race.svc/json/race/scanners/add/"+series_event_raceid+"/"+qrcode, new asynchttpresponsehandler() {}
where series_event_raceid=103 , qrcode=r12g***
anyone please me
here logcat
08-18 10:06:24.272: w/system.err(5297): javax.net.ssl.sslexception: hostname in certificate didn't match: <development.racerunner.com> != <racerunner.com> or <racerunner.com> 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.conn.ssl.abstractverifier.verify(abstractverifier.java:185) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.conn.ssl.browsercompathostnameverifier.verify(browsercompathostnameverifier.java:54) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.conn.ssl.abstractverifier.verify(abstractverifier.java:114) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.conn.ssl.abstractverifier.verify(abstractverifier.java:95) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.conn.ssl.sslsocketfactory.createsocket(sslsocketfactory.java:388) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.impl.conn.defaultclientconnectionoperator.openconnection(defaultclientconnectionoperator.java:165) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.impl.conn.abstractpoolentry.open(abstractpoolentry.java:164) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.impl.conn.abstractpooledconnadapter.open(abstractpooledconnadapter.java:119) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.impl.client.defaultrequestdirector.execute(defaultrequestdirector.java:360) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:555) 08-18 10:06:24.272: w/system.err(5297): @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:487) 08-18 10:06:24.272: w/system.err(5297): @ com.loopj.android.http.asynchttprequest.makerequest(asynchttprequest.java:98) 08-18 10:06:24.272: w/system.err(5297): @ com.loopj.android.http.asynchttprequest.makerequestwithretries(asynchttprequest.java:112) 08-18 10:06:24.272: w/system.err(5297): @ com.loopj.android.http.asynchttprequest.run(asynchttprequest.java:68) 08-18 10:06:24.272: w/system.err(5297): @ java.util.concurrent.executors$runnableadapter.call(executors.java:422) 08-18 10:06:24.272: w/system.err(5297): @ java.util.concurrent.futuretask.run(futuretask.java:237) 08-18 10:06:24.272: w/system.err(5297): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) 08-18 10:06:24.272: w/system.err(5297): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:587) 08-18 10:06:24.272: w/system.err(5297): @ java.lang.thread.run(thread.java:811) 08-18 10:06:24.272: i/fail camera arg1(5297): null 08-18 10:06:24.272: i/fail camera arg2(5297): null 08-18 10:06:24.272: i/fail camera arg3(5297): javax.net.ssl.sslexception: hostname in certificate didn't match: <development.racerunner.com> != <racerunner.com> or <racerunner.com>
you can use sslsocketfactory.allow_all_hostname_verifier
sslsocketfactory sf = new sslsocketfactory( sslcontext.getinstance("tls"), sslsocketfactory.allow_all_hostname_verifier); scheme sch = new scheme("https", 443, sf); httpclient.getconnectionmanager().getschemeregistry().register(sch); httpget httpget = new httpget("https://host/");
where trying connect.
Comments
Post a Comment