java - How to ensure that a android app is accessing the Real server -
java - How to ensure that a android app is accessing the Real server -
i've implemented https connection servlet running rest api. device able connect server using https. device accepting server's certificate , establishing https.
how create sure device accepts particular certificate? intention should not able setup false server identifying right server using self-signed certificate.
in browser environment, user see chrome's crossed out https in url , know certificate not verified. how ensure app.
the procedure called certificate validation , pretty standard. classes , components perform validation you, others leave manual implementation , control.
validation ensures (in ideal world) connecting legitimate server, i.e. server host name , name in presented certificate match. requires server has acquired valid ca-signed (we omit self-signed variants lack of security , flexibility) certificate needed host name. far good.
now can either rely on pre-implemented certificate validation or implement own or add together own checks pre-implemented validation procedure. implementing own validation cumbersome task, let's assume client code utilize performs validation (you have not specified code utilize connection can't comment on it). can rely on it, however in countries state agencies perlustrate traffic, , doing acquire (or generate on-the-fly in cases) certificates false nature valid if follow validation procedure blindly.
so if command both server , client , can implement additional validation (your client component or class lets this) additional check can compare issuer of certificate (or whole certificate chain) issuer know valid. less flexible , extent against pki rules, approach reduces chance false certificate generated , accepted valid. thought know certificate utilize , ca used (and maybe utilize in future), can store info in client , compare during validation.
you can read more certificate validation searching here on "certificate validation" - quite popular topic.
java android servlets ssl
Comments
Post a Comment