| Input Parameter | Description |
| serverName | Name of Admin or Managed Server where update is required |
| CustIdentityKeyStoreName | Identity Keystore containing the private and public key of the server |
| CustIdentityKeyStorePassPhrase | Password of Identity Keystore |
| CustTrustKeyStoreFileName | Trust keystore containing CA certificates |
| CustServerPrivateKeyAlias | Alias/name of the private key stored in identity keystore |
| CustServerPrivateKeyPassPhrase | Password for private key. (Generally it is kept same as password of identity keystore) |
| domainHome | Absolute path of domain |
try:
print "Setup KeyStore and SSL"
cd ("/Servers/" + serverName)
CustIdentityKeyStorePassPhraseEncrypted = encrypt (CustIdentityKeyStorePassPhrase, domainHome)
set ("KeyStores", "CustomIdentityAndCustomTrust")
set ("CustomIdentityKeyStoreFileName", CustIdentityKeyStoreName)
set ("CustomIdentityKeyStorePassPhrase", CustIdentityKeyStorePassPhrase)
set ("CustomIdentityKeyStorePassPhraseEncrypted", CustIdentityKeyStorePassPhraseEncrypted)
set ("CustomIdentityKeyStoreType", "JKS")
set ("CustomTrustKeyStoreFileName", CustTrustKeyStoreFileName)
set ("CustomTrustKeyStorePassPhrase", CustIdentityKeyStorePassPhrase)
set ("CustomTrustKeyStorePassPhraseEncrypted", CustIdentityKeyStorePassPhraseEncrypted)
set ("CustomIdentityKeyStoreType", "JKS")
print "Keystore Setup Successful"
cd ("SSL/"+ serverName)
set ("ServerPrivateKeyAlias", CustServerPrivateKeyAlias)
set ("ServerPrivateKeyPassPhrase", CustServerPrivateKeyPassPhrase)
CustServerPrivateKeyPassPhraseEncrypted = encrypt (CustOutboundPrivateKeyPassPhrase, domainHome)
set ("ServerPrivateKeyPassPhraseEncrypted", CustServerPrivateKeyPassPhraseEncrypted)
print "SSL Setup Successful"
except Exception, e:
print e
print "Error while trying to Setup KeyStore and SSL!!!"
dumpStack()
raise
cancelEdit('y')
activateTheChanges()
disconnectFromServer()
exit()