0
votes

I'm trying to use MuleSoft's decryption on HTTP requests. I'm doing this also on GET requests.

I get the following error:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ERROR 2015-05-17 13:00:35,630 [[broker1-secure].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy: ******************************************************************************** Message : Failed to invoke decrypt. Message payload is of type: NullPayload Code : MULE_ERROR-29999 -------------------------------------------------------------------------------- Exception stack is: 1. Could not decrypt the input. The input has to be a byte array,Input Stream or String (java.lang.RuntimeException)
org.mule.modules.security.encryption.encrypters.JCEEncrypterModule:59 (null) 2. Failed to invoke decrypt. Message payload is of type: NullPayload (org.mule.api.MessagingException)
org.mule.devkit.processor.DevkitBasedMessageProcessor:128 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html) -------------------------------------------------------------------------------- Root Exception stack trace: java.lang.RuntimeException: Could not decrypt the input. The input has to be a byte array,Input Stream or String at org.mule.modules.security.encryption.encrypters.JCEEncrypterModule.decrypt(JCEEncrypterModule.java:59) at org.mule.modules.security.encryption.EncryptionModule.decrypt(EncryptionModule.java:213) at org.mule.modules.security.encryption.processors.DecryptMessageProcessor$1.process(DecryptMessageProcessor.java:165) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

Shouldn't it be possible? Try to decrypt payload, and if nothing to decrypt then continue?

1

1 Answers

1
votes

It would be better to only decrypt if the payload is not null: it's better to avoid raising exceptions if you can.

For this, you can use a choice router to decrypt only if the payload is not null.