_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

SSL/TLS certificates in Java applications

11. 10. 2011 1 min read CORE SYSTEMSsecurity
SSL/TLS certificates in Java applications

Keystore vs. Truststore

The keystore contains your private key and certificate. The truststore contains CA certificates you trust. Never modify the default cacerts — create a copy.

Keytool

Import a certificate, generate a self-signed certificate, export, list contents. For mutual TLS (enterprise integration): both parties need both a keystore and a truststore.

Debugging and common errors

-Djavax.net.debug=ssl,handshake for detailed logging. PKIX path failed = CA missing from truststore. Certificate expired = renew it. Hostname mismatch = wrong CN/SAN.

Automation

A Perl script + Nagios monitoring of certificate expiry. 60 days = WARNING, 30 days = CRITICAL. With dozens of servers, manual management is unsustainable.

Rules

  1. Never disable SSL validation. 2. Use a custom truststore. 3. Monitor certificate expiry. 4. Document the certificate inventory.
ssltlssecurityjava
Share:

CORE SYSTEMS

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.

Need help with implementation?

Our experts can help with design, implementation, and operations. From architecture to production.

Contact us