Prabhjot
Prabhjot

Reputation: 5014

SoapUI Cannot encrypt data

I am having issues with my SoapUI. Error log is following

Mon Jul 06 17:18:16 NZST 2015:ERROR:org.apache.ws.security.WSSecurityException: Cannot encrypt data
  org.apache.ws.security.WSSecurityException: Cannot encrypt data
at org.apache.ws.security.message.WSSecEncrypt.encryptElement(WSSecEncrypt.java:493)
at org.apache.ws.security.message.WSSecEncrypt.doEncryption(WSSecEncrypt.java:406)
at org.apache.ws.security.message.WSSecEncrypt.encryptForRef(WSSecEncrypt.java:289)
at org.apache.ws.security.message.WSSecEncrypt.build(WSSecEncrypt.java:246)
at com.eviware.soapui.impl.wsdl.support.wss.entries.EncryptionEntry.process(EncryptionEntry.java:284)
at com.eviware.soapui.impl.wsdl.support.wss.OutgoingWss.processOutgoing(OutgoingWss.java:175)
at com.eviware.soapui.impl.wsdl.submit.filters.WssRequestFilter.filterWsdlRequest(WssRequestFilter.java:59)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterAbstractHttpRequest(AbstractRequestFilter.java:39)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:33)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:172)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:80)
at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:217)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:364)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:212)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
 Caused by: org.apache.xml.security.encryption.XMLEncryptionException: Illegal key size or default parameters
Original Exception was java.security.InvalidKeyException: Illegal key size or default parameters
at org.apache.xml.security.encryption.XMLCipher.encryptData(Unknown Source)
at org.apache.xml.security.encryption.XMLCipher.encryptData(Unknown Source)
at org.apache.xml.security.encryption.XMLCipher.encryptElementContent(Unknown Source)
at org.apache.xml.security.encryption.XMLCipher.doFinal(Unknown Source)
at org.apache.ws.security.message.WSSecEncrypt.encryptElement(WSSecEncrypt.java:490)
... 23 more

This post Java Security: Illegal key size or default parameters? suggest that I need to install the unlimited strength files. I have done that but still having the same issue. Would be thankful if anyone please give me an insight on this.

Thanks.

Upvotes: 1

Views: 1185

Answers (1)

paxx
paxx

Reputation: 9

I also encountered your problem.

You can find the jre that your soapui uses by going to Help-> System Properties.

Look for the line java.home Mine was (java.home=/Applications/SoapUI-4.6.4.app/Contents/PlugIns/jre.bundle/Contents/Home/jre) (using an older soap-ui version because from 5.1 the decryption was broken somehow)

so in that jre folder go to the lib/security subfolder and paste the zip contents of the corresponding java version zip file:

(soapui 4.6 is java 7) Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 Download

(soapui 5.2 is java 8) Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8 Download

Upvotes: 1

Related Questions