{"id":5671,"date":"2016-04-13T13:55:44","date_gmt":"2016-04-13T05:55:44","guid":{"rendered":"http:\/\/rmohan.com\/?p=5671"},"modified":"2016-04-13T13:55:44","modified_gmt":"2016-04-13T05:55:44","slug":"keystores-and-truststores-for-websphere","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5671","title":{"rendered":"keystores and truststores for websphere"},"content":{"rendered":"<p>This post will guide you on how to create and configure custom keystores and truststores instead of using the default keystores and truststores that are created during the profile creation.<\/p>\n<p>Imagine if you have two or more applications running on the same application server profile, Then we can use this feature if any application needs specific certificates. The keystores and truststores can be configured at server\/cluster level.<\/p>\n<p>-&gt; Default Keystores and Truststores are created and configured by default at cell level during the profile creation.<\/p>\n<p>-&gt; Custom Keystores and Truststores can be created and configured for at server\/application\/cluster\/node level. This will ensure the keystores are independent of other applications.<\/p>\n<p><b><strong>Incase of the following error:<\/strong><\/b><\/p>\n<p>Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure<\/p>\n<p>The following steps can be used to fix this error.<\/p>\n<p><b><strong>Creation of Keystore and Truststores from console:<\/strong><\/b><\/p>\n<p><b><strong>Step 1: \u00a0<\/strong><\/b>Navigate to Security &gt;SSL certificate and key management &gt; Manage endpoint security configurations &gt; Inbound &gt; NodeName &gt; ServerName &gt;\u00a0\u00a0Key stores and certificates &gt; New<\/p>\n<p><b><strong>Step 2:<\/strong><\/b> Fill the relevant fields.<\/p>\n<p><b><strong>Name :<\/strong><\/b> CustomKeystore<br \/>\n<b><strong>Description : <\/strong><\/b>Keystore specific to an application<br \/>\n<b><strong>Management\u00a0scope:<\/strong><\/b>\u00a0This\u00a0is\u00a0grayed\u00a0out,\u00a0This\u00a0shows the scope it is currently in, (Cell)(Node)(Server) -&gt;\u00a0It\u00a0belongs to server\u00a0scope.<br \/>\n<b><strong>Path : <\/strong><\/b>The Path Where you want the keystore.p12 to be created.<br \/>\n<b><strong>Password : <\/strong><\/b>Defualt will be WebAS<br \/>\n<b><strong>Type :<\/strong><\/b> I have choosen p12, You can choose what ever you want to use.<br \/>\n<b><strong>Remotely Managed :<\/strong><\/b>\u00a0In case\u00a0if the path of the key file is present in a remote server, You have to check this\u00a0option and provide the alias name of that server which is present in serverindex.xml or else error will be displayed.<\/p>\n<p><b>Step 3: <\/b>Once you click on apply, a file with the name that you have given in the path will be created.<\/p>\n<p><b><strong>Step 4:<\/strong><\/b> The same process can be followed to create a trust store.<\/p>\n<p>With the above steps, The keystore and truststores are created.<\/p>\n<p>Now to configure the websphere application server to identify these keystores and truststores and override the default keystore and truststore properties, The following steps are required to be followed.<\/p>\n<p><b>Step 1: <\/b>Login to the websphere application server console,<\/p>\n<p><b><strong>Step 2: <\/strong><\/b>Navigate to Servers &gt; Server Types &gt; WebSphere application Servers &gt; Server (Select the server that you want these customized keystores to be used) &gt; Java and Process Management &gt; Process Definition &gt; Java Virtual Machine<\/p>\n<p><b><strong>Step 3:\u00a0 <\/strong><\/b>Add these following properties to the Generic arguments.<\/p>\n<p>-server -Djavax.net.ssl.trustStore=Path to truststore\/trust.p12 -Djavax.net.ssl.trustStorePassword=WebAS -Djavax.net.ssl.trustStoreType=PKCS12 -Djavax.net.ssl.keyStore=Path to Keystore\/key.p12 -Djavax.net.ssl.keyStorePassword=WebAS -Djavax.net.ssl.keyStoreType=PKCS12<\/p>\n<p><b><strong>Step 4: \u00a0<\/strong><\/b>Apply the settings and restart the JVM and check the process information<\/p>\n<p>ps -eaf | grep java | grep &lt;servername&gt;<\/p>\n<p>This should reflect the parameters added in the Generic arguments.<\/p>\n<p>That&#8217;s it. You are now using the customized keystores and certificates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will guide you on how to create and configure custom keystores and truststores instead of using the default keystores and truststores that are created during the profile creation.<\/p>\n<p>Imagine if you have two or more applications running on the same application server profile, Then we can use this feature if any application needs [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5671"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5671"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5671\/revisions"}],"predecessor-version":[{"id":5672,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5671\/revisions\/5672"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}