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

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

Explorer ,
Aug 01, 2014 Aug 01, 2014

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.

Views

708

Translate

Translate

Report

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

Copy link to clipboard

Copied

Can anyone help me with this please?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

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>

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Reported as a bug

Bug#3802104 - JSON and HTTPS

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

+1 vote

Votes

Translate

Translate

Report

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
Documentation