Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CF10 - returntype JSON HTTPS - Input length must be multiple of 16 when decrypting with padded cipher

Explorer ,
Aug 01, 2014 Aug 01, 2014

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.

987
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 06, 2014 Aug 06, 2014

Can anyone help me with this please?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 07, 2014 Aug 07, 2014

Could you show us the code that is causing the error?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 07, 2014 Aug 07, 2014

<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>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 07, 2014 Aug 07, 2014

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 07, 2014 Aug 07, 2014

Reported as a bug

Bug#3802104 - JSON and HTTPS

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 08, 2014 Aug 08, 2014
LATEST

+1 vote

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources