SSL Site

Hopefully and easy question.

I have a site that I am developing that should run entirely under SSL,
using CB 2.6, CF 9 on Windows. While I know that I can configure IIS
to only allow https access, my preference would be for http and https
to work, however, if the site is accessed with http, it should
automatically redirect to https mode.

I realize that I can use the buildLink() with the SSL flag, but my
question is how I would go about making everything run under SSL and,
therefore, not needing to specify the SSL bit. Is this doable
(easily)?

Cheers!

Kevin Anderson
Superlative Solutions, Inc.

I would do the following:

Create a request interceptor that inspects the incoming request via a preProcess method and redirects to the same URL with SSL support if the request was not secure.
http://wiki.coldbox.org/wiki/Recipes:My_First_Interceptor.cfm

Second, I would create a Request Context Decorator and simply run super.BuildLInk(argumentCollection=arguments) after setting the SSL flag in the decorated function.
http://wiki.coldbox.org/wiki/Recipes:My_First_Request_Context_Decorator.cfm

Should be less than 10 lines of code for both steps.

Hope that makes sense.

Aaron