In this post, we are going to see how to configure Custom keystore and SSL in Weblogic 12c through WLST.
Before configuring ensure that your Weblogic server is up and running.
Use the below script and run the script through WLST to configure Keystore and SSL
===== SCRIPT STARTS ============
// connect to Weblogic server. alter the ip-address and port as per your server configurations
connect('admin', '[email protected]', t3://ip-address:port)
edit()
startEdit()
// We are going to update the Keystore and SSL in AdminServer. Alter as per your needs
cd('/Servers/' + 'AdminServer')
cmo.setKeyStores('CustomIdentityAndCustomTrust')
cmo.setCustomIdentityKeyStoreFileName('/path/to/keystore/jks/file')
cmo.setCustomIdentityKeyStorePassPhrase('passphrase')
cmo.setCustomIdentityKeyStoreType('JKS')
cmo.setCustomTrustKeyStoreFileName('/path/to/keystore/jks/file')
cmo.setCustomTrustKeyStorePassPhrase('passphrase')
cmo.setCustomTrustKeyStoreType('JKS')
Till now, we have made changes only for the Keystore configuration. Now we are going to make changes for SSL
cd('/Servers/' + 'AdminServer' + '/SSL/' + 'AdminServer')
// update the below parameter
cmo.setServerPrivateKeyAlias('selfsigned')
set('ServerPrivateKeyPassPhrase', 'passphrase')
cmo.setUseServerCerts(true)
cmo.setHostnameVerifier(None)
cmo.setTwoWaySSLEnabled(false)
save()
activate()
disconnect()
exit()
===== SCRIPT ENDS ======
Save the above scripts as python scripts and run the file using the command java weblogic.WLST file_name.py