Skip to main content
Participant
March 12, 2014
Question

CFChart images broken when creating a PDF document with SSL

  • March 12, 2014
  • 1 reply
  • 1310 views

I have a report that I create with Coldfusion, that includes a number of CFChart objects.  I recently installed a new SSL certificate, and now all the charts show up as broken links.   It shows up fine if I try and display this as HTML. On the chance it was something weird about my (lengthly) report, I created the following sample code that I saved in a file called foo.cfm:

<cfset sDir = "C:/">

<cfset filename = "foo123.pdf">

 

<cfdocument format="pdf" filename="#filename#" overwrite="yes" marginleft=".7" margintop=".3" backgroundvisible="yes">

TEST 12345

<br>

<br>

<div style="height:500px;float:right; margin-left:10px; margin-top:10px; margin-right:10px; margin-bottom:10px;">

    <cfchart

        format="png"

        chartwidth="400"

        chartheight="360"

        showborder="no"

        databackgroundcolor="##ffffff" 

        fontbold="yes"

        sortxaxis="no"

        yoffset=".1"

        scaleto="100"

        showmarkers="no"

        show3d="no"

        fontsize="11"

          >

    <cfchartseries type="bar" datalabelstyle="none" seriescolor="##00CC99" paintstyle="shade">

    <cfchartdata item="B" value="40">

    <cfchartdata item="A" value="50">

    <cfchartdata item="E" value="80">

    <cfchartdata item="S" value="30">

    </cfchartseries>

    </cfchart>

</div>

 

</cfdocument>

 

<cfoutput>

<a href="#filename#" target="_blank">Foo</a>

</cfoutput>

If I go to the URL https://www.mywebsite.com/foo.cfm, the foo.pdf file shows a broken link.  If instead I go to http://www.mywebsite.com/foo.cfm the image of the chart shows up just fine. 

The weird thing is that I have an older server running CF9.0.0.  On this server it works just fine.  On another server with 9.0.1, it breaks.  Same with 9.0.2, and CF 10. 

I read something about needing to install the cert in a keystore, and I did this but it changed nothing.  The image is still broken in the pdf. 

Any help would be greatly appreciated.  We have been able to work around the issue by posting the image in a non-secure location, but this seems like a hack, not a proper solution.

This topic has been closed for replies.

1 reply

Anit_Kumar
Community Manager
Community Manager
March 13, 2014

Hi Marstano,

You would need to use the subject/server name that is in the certificate in the URL in the browser in order for local images and cfchart to resolve.

 

Import the certificate to CF's cert store (cacerts). CF will properly resolve local images and cfchart.

Regards,

Anit Kumar

MarstanoAuthor
Participant
March 14, 2014

Hi Anit, thanks for the feedback.  I did try this on a different server, using the instructions here:

http://helpx.adobe.com/coldfusion/kb/import-certificates-certificate-stores-coldfusion.html

and then restarted ColdFusion, but it didn't seem to fix the issue.  How would I check that the certificate has been correctly imported?  Also, how can I define what URL Coldfusion uses to get the images it creates with CFChart?   Though it seems to me this should "just work" by default, if I've followed the steps correctly, and I should have to edit any config files.

Participating Frequently
September 11, 2015

I too tried this and was unable to make it work.