Monthly Archives: July 2006

Importing SSL Certificates with Keytool – Finally

From time to time I have had the desire to use SSL certificates from Certificate Authorities (CA’s) which are not included in the default build of Jrun. There are some tutorials on how to do this:

Despite these resources, I could never get the import to work. It would give me the message that it imported and the list test would reveal that it worked but then ColdFusion couldn’t connect to the secured resource. After repeated attempts, I would just figure out an alternate solution to my problem.

That is until today. I was trying it again, and to reduce my frustration, I created a batch file on the desktop of the server. When I ran the batch file, I saw that a cacerts file was created on my desktop. I did some digging, and relized that I was creating a new cacerts file every time I tried to do this, instead of appending the cert to the existing cacerts file.

So the solution was to run the keytool commands from the directory the cacerts file is located in. After you do that successfully, you need to restart the ColdFusion instance you wish to consume the secure services with.

I can’t believe I overlooked something that straightforward but then again, maybe someone else has, and could use this piece of information.

Movable Type 3.3

Following a full backup, I upgraded to Movable Type 3.3. If you are reading this, then posting from Word 2007 Beta works. There were absolutely no problems with this upgrade. It still generates my ColdFusion without errors. I did a complete rebuild, just a few errors related to a few bum plugins.

Great job on this release. Now if only the blog-spam blockers work better.

Asynchronous CFML without a Gateway

I came up with this while coming up with the wrong answer to a different question. My hope is that it is the wrong answer to someone else’s question

How do you run an asynchronous request for without having access to a Asynchronous CFML Gateway?

  1. Encapsulate the code to be run asynchronously into a CFFunction.
  2. Set the access for the function to “Remote”
  3. Put the function in a cfc.
  4. (Optional) Secure the method so that it is called only from server the code resides on.
  5. Call the code as a webservice using CFinvoke, with a timeout of “1”.
  6. Wrap the code in a cftry block.
  7. In the cfcatch add the code block below.

  8. That should do it.

<cfif not FindNoCase("Read timed out", cfcatch.Detail)>
<cfrethrow />
</cfif>

The CFcatch will prevent timeouts from being perceived as errors. The rethrow will ensure that other errors get treated as such.

Now there are some limitations to this. The process will take a minimum of 1 second. Which is slower than using the gateway method, but beats having to pay for the Enterprise version. Granted you don’t have a separate application and session scope like you do with the Gateway, but you can if you put the CFC in a subfolder with its own application.cfc or application.cfm. You also don’t get information back from the call, but neither do you with a CFML gateway.

Hopefully, this can be of use to someone.