Copy link to clipboard
Copied
I have a ColdFusion service that doing basic authentication using SQL and returning a structure as JSON
The structure has one element AUTHENTICATED = true . The JSON looks like below
{
"AUTHENTICATED": true
}
The service works just fine when using HTTP but when using HTTPS I get this error .
An error occurred while trying to encrypt or decrypt your input string: Input length must be multiple of 16 when decrypting with padded cipher.
Copy link to clipboard
Copied
Can anyone help me with this please?
Copy link to clipboard
Copied
Could you show us the code that is causing the error?
Copy link to clipboard
Copied
<cfcomponent accessors="true">
<cffunction name="loginUser" access="remote" returntype="struct" returnformat="JSON" >
<cfargument name="username" type="string" required="yes">
<cfargument name="password" type="string" required="yes">
<cfargument name="applicationId" type="string" required="yes">
<cfif GetAuthUser() neq "">
<cflogout>
</cfif>
<cfset var retargs = StructNew()>
<cfset retargs.authenticated="NO">
<cflogin>
<cfset euserArray = new doeadmin.services.everifyUserService().login(arguments.username, arguments.password) />
<cfset userCount = new doeadmin.services.everifyUserService().searchCount(arguments.username, arguments.password) />
<cfif userCount eq 1>
<cfset retargs.authenticated="YES">
<cfset session.uuid = #euserArray[1].getUserId()#>
<cfset session.firstName = #euserArray[1].getFirstName()#>
<cfloginuser name="#arguments.username#" password="#arguments.password#" roles="">
<cfelse>
<cfset retargs.authenticated="NO">
</cfif>
</cflogin>
<cfreturn retargs>
</cffunction>
<cffunction name="logoutUser" access="remote" returntype="string" >
<cflogout/>
<cfreturn "YES"/>
</cffunction>
</cfcomponent>
Copy link to clipboard
Copied
Apparently nothing untoward about the code. So the error message is likely from Tomcat. As your Coldfusion code is correct, you are justified in reporting the issue as a bug.
Copy link to clipboard
Copied
Reported as a bug
Copy link to clipboard
Copied
+1 vote