Forum Discussion

Happy's avatar
Happy
Contributor
9 years ago

How to set Keystore using Groovy script

I need to set related link to certificate. But in WS-Security Configuration - Keystores I can set only absolute path. How I can do this using scripts?

  • I set the SSL Keystore and password programmatically

    import com.eviware.soapui.settings.SSLSettings
    import com.eviware.soapui.SoapUI 
    
    // set
    SoapUI.settings.setString( SSLSettings.KEYSTORE, pathToKeystore )
    SoapUI.settings.setString( SSLSettings.KEYSTORE_PASSWORD, keystorePassword )
    
    // get
    SoapUI.settings.getString( SSLSettings.KEYSTORE, "value to return if there is no such setting set" )

    https://www.soapui.org/scripting-properties/tips-tricks.html