{"id":5005,"date":"2015-08-03T17:23:20","date_gmt":"2015-08-03T09:23:20","guid":{"rendered":"http:\/\/rmohan.com\/?p=5005"},"modified":"2015-08-03T17:23:20","modified_gmt":"2015-08-03T09:23:20","slug":"configure-ssl-on-weblogic","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5005","title":{"rendered":"Configure SSL on Weblogic"},"content":{"rendered":"<h1>WebLogic Server 11g and 12c : Configure SSL for a Managed Server<\/h1>\n<p>By default WebLogic managed servers are configured with demo identity and trust information. This should be reconfigured to use real, or self-signed certificates. This article describes how this is done.<\/p>\n<ul>\n<li><a href=\"https:\/\/oracle-base.com\/articles\/11g\/weblogic-configure-ssl-for-a-managed-server#create-keystores-and-certificates\">Create Keystores and Certificates<\/a><\/li>\n<li><a href=\"https:\/\/oracle-base.com\/articles\/11g\/weblogic-configure-ssl-for-a-managed-server#clustered-environments\">Clustered Environments<\/a><\/li>\n<li><a href=\"https:\/\/oracle-base.com\/articles\/11g\/weblogic-configure-ssl-for-a-managed-server#configure-ssl-for-managed-server\">Configure SSL for Managed Server<\/a><\/li>\n<li><a href=\"https:\/\/oracle-base.com\/articles\/11g\/weblogic-configure-ssl-for-a-managed-server#configure-node-manager\">Configure Node Manager<\/a><\/li>\n<li><a href=\"https:\/\/oracle-base.com\/articles\/11g\/weblogic-configure-ssl-for-a-managed-server#basic-constraints-extension-error\">Basic Constraints Extension Error<\/a><\/li>\n<\/ul>\n<p>Related articles.<\/p>\n<ul>\n<li><a href=\"https:\/\/oracle-base.com\/articles\/linux\/create-self-signed-ssl-certificates\">Creating Self-Signed SSL Certificates<\/a><\/li>\n<\/ul>\n<h2>Create Keystores and Certificates<\/h2>\n<p>In order to configure SSL for a managed server, you are going to need identity and trust keystores and a certificate. If you don&#8217;t have a real certificate, you can create a self-signed certificate, as described <a href=\"https:\/\/oracle-base.com\/articles\/linux\/create-self-signed-ssl-certificates\">here<\/a> and in this article.<\/p>\n<p>For this article we will use a self-signed certificate, created using the <a href=\"https:\/\/oracle-base.com\/articles\/linux\/create-self-signed-ssl-certificates#keytool\">keytool<\/a> utility. Perform the following steps as the &#8220;oracle&#8221; user.<\/p>\n<p>Make a directory to hold the keystores.<\/p>\n<pre>$ mkdir ~\/keystore\r\n$ cd ~\/keystore<\/pre>\n<p>Create the identity and trust keystores using the following commands. Notice the result of the <code>hostname<\/code> command is used in the &#8220;CN=&#8221; entry.<\/p>\n<pre>$JAVA_HOME\/jre\/bin\/keytool -genkey -keyalg RSA -alias selfsigned -keystore identity.jks \\\r\n   -dname \"CN=`hostname`, OU=My Department, O=My Company, L=Birmingham, ST=West Midlands, C=GB\" \\\r\n   -storepass password1 -validity 3600 -keysize 2048 -keypass password1\r\n\r\n$JAVA_HOME\/jre\/bin\/keytool -selfcert -v -alias selfsigned -keypass password1 -keystore identity.jks \\\r\n   -storepass password1 -storetype jks -validity 3600\r\n\r\n$JAVA_HOME\/jre\/bin\/keytool -export -v -alias selfsigned -file \"`hostname`-rootCA.der\" -keystore identity.jks \\\r\n   -storepass password1\r\n\r\n# Trust? yes\r\n$JAVA_HOME\/jre\/bin\/keytool -import -v -trustcacerts -alias selfsigned -file \"`hostname`-rootCA.der\" \\\r\n   -keystore trust.jks -storepass password1<\/pre>\n<p>We now have a self-signed certificate in a keystore will the following details, which will be referred back to later.<\/p>\n<ul>\n<li>Identity Keystore: &#8220;\/home\/oracle\/keystore\/identity.jks&#8221;<\/li>\n<li>Trust Keystore: &#8220;\/home\/oracle\/keystore\/trust.jks&#8221;<\/li>\n<li>Alias: selfsigned<\/li>\n<li>Store Password: password1<\/li>\n<li>Key Password: password1<\/li>\n<li>Valid for: 3600 Days (Approx 10 Years)<\/li>\n<\/ul>\n<h2>Clustered Environments<\/h2>\n<p>If you are working with WebLogic clusters spanning multiple machines, you have to make sure all certificates in the cluster are marked as trusted, otherwise the AdminServer will not be able to communicate with all the node managers.<\/p>\n<p>Assuming you have a two node cluster, as described in <a href=\"https:\/\/oracle-base.com\/articles\/11g\/weblogic-11g-clustered-domains\">this article<\/a>, you would have to do the following.<\/p>\n<p>Make sure you have followed the process described in the previous section on each of the machines making up the cluster before continuing.<\/p>\n<p>Make sall certificates are available on all nodes by copying them into the keystore folders on each server.<\/p>\n<pre>cd ~\/keystore\r\nscp wls11g-1.localdomain-rootCA.der oracle@wls11g-2.localdomain:\/home\/oracle\/keystore\r\nscp oracle@wls11g-2.localdomain:\/home\/oracle\/keystore\/wls11g-2.localdomain-rootCA.der .<\/pre>\n<p>On the first node, load the certificate generated on the second node into the local trust keystore using the following command.<\/p>\n<pre>$JAVA_HOME\/jre\/bin\/keytool -import -v -trustcacerts -alias selfsigned2 -file wls11g-2.localdomain-rootCA.der \\\r\n   -keystore trust.jks -storepass password1<\/pre>\n<p>On the second node, load the certificate generated on the first node into the local trust keystore using the following command.<\/p>\n<pre>$JAVA_HOME\/jre\/bin\/keytool -import -v -trustcacerts -alias selfsigned2 -file wls11g-1.localdomain-rootCA.der \\\r\n   -keystore trust.jks -storepass password1<\/pre>\n<p>You can now continue with the rest of the configuration.<\/p>\n<h2>Configure SSL for Managed Server<\/h2>\n<p>This process should be followed for the AdminServer and all managed servers.<\/p>\n<ul>\n<li>In the WebLogic Server Administration Console, click on &#8220;Servers&#8221; in the &#8220;Domain Structure&#8221; tree.<\/li>\n<li>Click on the managed server you wish to configure.<\/li>\n<li>Click on the &#8220;Configuration &gt; Keystores&#8221; tab and sub-tab.<\/li>\n<li>If you are running on production mode, click the &#8220;Lock &amp; Edit&#8221; Button.<\/li>\n<li>Click the &#8220;Change&#8221; button next to the &#8220;Keystores&#8221; setting.<\/li>\n<li>Select the &#8220;Custom Identity and Custom Trust&#8221; option and click the &#8220;Save&#8221; button.<\/li>\n<li>Enter the identity details. For example.\n<ul>\n<li>Custom Identity Keystore: \/home\/oracle\/keystore\/identity.jks<\/li>\n<li>Custom Identity Keystore Type: JKS<\/li>\n<li>Custom Identity Keystore Passphrase: password1<\/li>\n<li>Confirm Custom Identity Keystore Passphrase: password1<\/li>\n<\/ul>\n<\/li>\n<li>Enter the trust information. For example.\n<ul>\n<li>Custom Identity Keystore: \/home\/oracle\/keystore\/trust.jks<\/li>\n<li>Custom Identity Keystore Type: JKS<\/li>\n<li>Custom Identity Keystore Passphrase: password1<\/li>\n<li>Confirm Custom Identity Keystore Passphrase: password1<\/li>\n<\/ul>\n<\/li>\n<li>Click the &#8220;Save&#8221; button.<\/li>\n<li>Click the &#8220;SSL&#8221; tab.<\/li>\n<li>Enter the identity details. For example.\n<ul>\n<li>Private Key Alias: selfsigned<\/li>\n<li>Private Key Passphrase: password1<\/li>\n<li>Confirm Private Key Passphrase: password1<\/li>\n<\/ul>\n<\/li>\n<li>Click the &#8220;Save&#8221; button.<\/li>\n<li>If you are running in production mode, click the &#8220;Activate Changes&#8221; button.<\/li>\n<li>Restart the managed server.<\/li>\n<\/ul>\n<p>The managed server will now be using the new identity and trust keystores.<\/p>\n<h2>Configure Node Manager<\/h2>\n<p>Edit the &#8220;$WL_HOME\/common\/nodemanager\/nodemanager.properties&#8221; file, adding the following entries. The values used reflect the information used to create the keystores above.<\/p>\n<pre>KeyStores=CustomIdentityAndCustomTrust\r\nCustomIdentityKeystoreType=jks\r\nCustomIdentityKeyStoreFileName=\/home\/oracle\/keystore\/identity.jks\r\nCustomIdentityKeyStorePassPhrase=password1\r\nCustomIdentityPrivateKeyPassPhrase=password1\r\nCustomIdentityAlias=selfsigned\r\nCustomTrustKeystoreType=jks\r\nCustomTrustKeyStoreFileName=\/home\/oracle\/keystore\/trust.jks\r\nCustomTrustKeyStorePassPhrase=password1<\/pre>\n<p>Restart the node manager.<\/p>\n<h2>Basic Constraints Extension Error<\/h2>\n<p>If you are using an older JRE, like Java 1.6, you may get the following type of error in the AdminServer logs.<\/p>\n<pre>&lt;BEA-090548&gt; &lt;The certificate chain received from ??? contained a V3 CA certificate\r\nwhich was missing the basic constraints extension&gt;<\/pre>\n<p>To fix this we need to replace the old certificates used by the JRE, and therefore <code>keytool<\/code>, when generating our self-signed certificates.<\/p>\n<p>Perform the following operations as the &#8220;oracle&#8221; user.<\/p>\n<p>Test you know the password for the JREs keystore. The default is &#8220;changeit&#8221;.<\/p>\n<pre>cd $JAVA_HOME\/jre\/lib\/security\r\n$JAVA_HOME\/bin\/keytool -keystore cacerts -list -storepass changeit<\/pre>\n<p>If that works, you are good to proceed.<\/p>\n<pre>cd $JAVA_HOME\/jre\/lib\/security\r\nchmod 755 cacerts\r\n$JAVA_HOME\/bin\/keytool -keystore cacerts -delete -alias entrust2048ca -storepass changeit<\/pre>\n<p>Download the following updated certificates and place them in the security directory on the server.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.entrust.net\/downloads\/binary\/entrust_l1c.cer\">entrust_l1c.cer<\/a> (L1C chain certificate)<\/li>\n<li><a href=\"https:\/\/www.entrust.net\/downloads\/binary\/entrust_2048_ssl.cer\">entrust_2048_ssl.cer<\/a> (2048 chain certificate)<\/li>\n<li><a href=\"https:\/\/www.entrust.net\/downloads\/binary\/entrust_ssl_ca.cer\">entrust_ssl_ca.cer<\/a> (1024 root certificate)<\/li>\n<\/ul>\n<p>Perform the following commands to load the certificates. The comment above certain commands gives you an idea of answers to prompts, or possible outcomes.<\/p>\n<pre># Trust? yes\r\n$JAVA_HOME\/bin\/keytool -keystore cacerts -import -alias entrust_l1c_chain -file entrust_l1c.cer -storepass changeit\r\n$JAVA_HOME\/bin\/keytool -keystore cacerts -import -alias entrust_2048_ssl_chain -file entrust_2048_ssl.cer -storepass changeit\r\n# Overwrite? yes\r\n$JAVA_HOME\/bin\/keytool -keystore cacerts -import -alias entrust_1024_ssl_ca_root -file entrust_ssl_ca.cer -storepass changeit\r\n# May fail. That's OK.\r\n$JAVA_HOME\/bin\/keytool -keystore cacerts -delete -alias entrustsslca -storepass changeit<\/pre>\n<p>You will have to recreate the <a href=\"https:\/\/oracle-base.com\/articles\/11g\/weblogic-configure-ssl-for-a-managed-server#create-keystores-and-certificates\">keystores you built previously<\/a>, so they will use the new certificates.<\/p>\n<p>Once this is done, restart the node manager and any domains using the identity and trust keystores.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WebLogic Server 11g and 12c : Configure SSL for a Managed Server <\/p>\n<p>By default WebLogic managed servers are configured with demo identity and trust information. This should be reconfigured to use real, or self-signed certificates. This article describes how this is done.<\/p>\n<p> Create Keystores and Certificates Clustered Environments Configure SSL for Managed Server Configure Node [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5005"}],"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=5005"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5005\/revisions"}],"predecessor-version":[{"id":5006,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5005\/revisions\/5006"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}