Downloading SSL server certificates to iOS/Android app -


we have developed app both ios , android communicates server via rest calls. in order user able login first time app, have first download server's ssl certificate (via https connection on browser or using openssl, download in der format) , manually load certificate folder on device (by connecting device computer , accessing storage). app, @ login, check folder , if correct certificate in there user able login... subsequent logins, users not have load certificate again.

now wondering if there way automate manual process outlined above? it's pretty tedious process, mobile app.

for example, connect server , download certificate straight device... kind of method have security risks?

thanks

try

hostnameverifier hostnameverifier = org.apache.http.conn.ssl.sslsocketfactory.allow_all_hostname_verifier;             defaulthttpclient client = new defaulthttpclient();             schemeregistry registry = new schemeregistry();             sslsocketfactory socketfactory = sslsocketfactory                     .getsocketfactory();             socketfactory                     .sethostnameverifier((x509hostnameverifier) hostnameverifier);             registry.register(new scheme("https", socketfactory, 443));             singleclientconnmanager mgr = new singleclientconnmanager(                     client.getparams(), registry);             // defaulthttpclient             defaulthttpclient httpclient = new defaulthttpclient(mgr,                     client.getparams());             httpsurlconnection.setdefaulthostnameverifier(hostnameverifier); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -