Tech Rocks

Coldfusion
Java
JQuery

An online resource for latest web technologies like Coldfusion, JRun, Pro*C, JQuery, HTML5, PHP, W3C, Java, J2EE, C, C++, ORACLE, PL/SQL, MySql, Ajax, Coldbox, Fusebox, UNIX, JavaScript, NodeJS and much more...

Tuesday, December 17, 2013

Enabling SSL on the ColdFusion

Open a command prompt.

 

Execute the following command:
cd C:\ColdFusion8\runtime\jre\bin

Create the keystore with this command:
keytool -genkey -dname "cn=127.0.0.1, ou=CF, o=jeetu, L=Decatur, ST=GA, C=US" -keyalg rsa -keystore mykey

 

If you have previously configured a keystore you might run into this error:
keytool error: java.lang.Exception: Key pair not generated, alias already exists

If you got the “already exists” error run this command to list the keystores:
keytool -list -v | more

If you got the “already exists” error run this command to delete the keystore:
keytool -delete -alias mykey

If you got the “already exists” error re-run the command to create the keystore.

 

Enter in a password when prompted (2 times)

 

Move the keystore file (mykey) to C:\ColdFusion8\runtime\lib\

 

Edit the config file C:\ColdFusion8\runtime\servers\coldfusion\SERVER-INF\jrun.xml with an xml editor of choice. This file is VERY sensitive so be sure to not screw up the syntax of it. You should probably make a copy of it before you edit it.


<!-- Uncomment this service to use SSL with the JRun Web Server
Note that you MUST create your own keystore before using this service -->
<service class="jrun.servlet.http.SSLService" name="SSLService">
<attribute name="enabled">true </attribute>
<attribute name="interface">* </attribute>
<attribute name="port">9100 </attribute>
<attribute name="keyStore">{jrun.rootdir}/lib/mykey </attribute>
<attribute name="keyStorePassword">mypassword </attribute>
<attribute name="trustStore">{jrun.rootdir}/lib/trustStore </attribute>
<attribute name="socketFactoryName">jrun.servlet.http.JRunSSLServerSocketFactory </attribute>
</service>


Restart the ColdFusion application service.

 

Create a test page in the ColdFusion 8 wwwroot and opening it in a web browser using: https://127.0.0.1:9100/testpage.cfm

0 comments :