, JSSE, SSLContext.
( null SSLContext.init(...)) , , (. Customization).
( truststore, , ).
, SSLContext :
KeyStore ks = KeyStore.getInstance(...);
ks.load(...);
KeyStore ts = KeyStore.getInstance(...);
ts.load(...);
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(ks, <the key password>);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(ts);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
, . , " " , (+ ) ( , ), ( , ), , .
, /, PCKS12, , .
EDIT: ( )
, , TrustManager, SSL- ?
.
cliemt, TrustManager, , ?
. CA , . ( - ), PKI , , CA.
TrustManager, ( ) , ( , ), , PKI. , , , .
; , , URL- , .
. URL-, , . HTTP SSLEngine, ( ).
SSLEngine - SSL/TLS Java , . , . HTTP-, ( /, , ). .
, , , . , ( SSL/TLS) , X509TrustManager, - ( SSL/TLS ), SSLSession ( ) . , . , PKI, - ( API, ).
, . , , , . CA : , .
, <the key password>? ; , - , (, ).
. , (, , ).