java - Certificate on the client's side? -


i have server application , client application.

the server uses https, , has .jks file. apart that, use authentication login , password.

i wonder if client side should use .cert certificate. thought client's certificate should match servers certificate, seems wrong.

i have troubles understatding topic, please understanding.

keystore

a java keystore (jks) repository of security certificates – either authorization certificates or public key certificates – used instance in ssl encryption.

  • in ibm websphere application server , oracle weblogic server, file extension jks serves keystore.
  • the java development kit maintains ca keystore in folder jre/lib/security/cacerts.

keystore comes in 2 flavors:

1. trust:
trust store contains certificates issued trust, root certificate ca.

2. identity:

  • an identity store contains own certificates , used authenticate when access external service.
  • a trust store not contain sensitive information, while identity stores contain sensitive information private keys.
  • contains demonstration private key server. keystore establishes identity server.


i wonder if client side should use .cert certificate.

if mean connect https service, should export server's ssl certificate , import in server's keystore, can import in jre/lib/security/cacerts.

client required have ssl certificate if 2 way ssl, meaning client required send ssl certificate server because server has requested same.

why required because using ssl handshake server send ssl certificate , client validate certificate trusted list of certificates present in keystore. if not validated ssl handshake cannot completed, , hence no communication can established. so, must have server's ssl certificate inside trusted store of certificates.

i thought client's certificate should match servers certificate, seems wrong.

yes, right, ssl certificates of 2 different parties different.

each party requires ssl certificate generate public-private key pair @ end , raise csr request certificate authority (ca), generate ssl certificate using provided key.


how export , import ssl certificates

to export certificate:

if can accessed using web click on https icon, view certificate , follow export commands.

if cannot accessed using web use openssl export certificate. use below command

openssl s_client -connect host:port -key our_private_key.pem -showcerts -cert our_server-signed_cert.pem 

to import certificate:

use command - keytool -import -trustcacerts -file /path/to/ca/ca.pem -alias ca_alias -keystore $java_home/jre/lib/security/cacerts

further reading on export , import:


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -