Tuesday, January 31, 2012

Oracle SOA Suite 11g - Configuring Weblogic Servers to Use the Custom Key stores


Oracle SOA Suite 11g - Important SQL queries to get the details about composites from SOAINFRA schema:

The below WLST script will help us to configure the custom key stores for the weblogic servers.

The details should be changed accordingly based on your environment.

import sys
print "@@@ Starting the script ..."
from java.util import *
from javax.management import *
from java.io import FileInputStream
#The directory of the domain configuration
#/app/oracle/products/11g/admin/domains
wlsDomain=os.environ["WLSDOMAIN"]
print "WLSDOMAIN="+wlsDomain
adminURL='t3://'+<<Admin Server IP>>+':'+<<Admin Server Port>>
adminUserName='weblogic'
adminPassword=<<Admin Server Password>>
connect(adminUserName, adminPassword, adminURL)
edit()
startEdit()
###################Configure KeyStores for cluster####################
print 'Applying changes to cluster'
##Applying for Admin Server
cd('/Servers/AdminServer')
##Identity key Store location
cmo.setCustomIdentityKeyStoreFileName(wlsDomain+'/certs/appIdentityKeyStore.jks')
set('CustomIdentityKeyStorePassPhrase', 'welcome1')
##Trust key Store location
cmo.setCustomTrustKeyStoreFileName(wlsDomain+'/certs/appTrustKeyStore.jks')
set('CustomTrustKeyStorePassPhrase', 'welcome1')
cmo.setKeyStores('CustomIdentityAndCustomTrust')
cmo.setCustomIdentityKeyStoreType('JKS')
cmo.setCustomTrustKeyStoreType('JKS')
cd('/Servers/AdminServer/SSL/AdminServer')
##Server Private key Alias
cmo.setServerPrivateKeyAlias(<<Admin Server Host Name>>)
set('ServerPrivateKeyPassPhrase', 'welcome1')
##Applying for SOA managed server
cd('/Servers/SOA1')
cmo.setCustomIdentityKeyStoreFileName(wlsDomain+'/certs/appIdentityKeyStore.jks')
set('CustomIdentityKeyStorePassPhrase', 'welcome1')
cmo.setCustomTrustKeyStoreFileName(wlsDomain+'/certs/appTrustKeyStore.jks')
set('CustomTrustKeyStorePassPhrase', 'welcome1')
cmo.setKeyStores('CustomIdentityAndCustomTrust')
cmo.setCustomIdentityKeyStoreType('JKS')
cmo.setCustomTrustKeyStoreType('JKS')
cd('/Servers/SOA1/SSL/SOA1')
cmo.setServerPrivateKeyAlias(<<SOA1 Server Host Name>>)
set('ServerPrivateKeyPassPhrase', 'welcome1')
save()
activate()


No comments:

Post a Comment