Hola Carlos,
after many attempts I got it.
My enviroment:
- I use Windows
- I use port 80 in AwareIM, so I installed SSL in port 443
- As I was not sure to get it, I started installing a free certificate from StarCom (https://www.startssl.com/)
- I have a domain name pointing to my AwareIM server
And the steps:
1) Create the keystore
keytool -genkey -alias tomcat -keyalg RSA -keysize 2048 -keystore path-to-keystore\mykeystore
You'll be asked for several info. The important is:
-Use domain name for First name and Last name info. (ex: mydomain.com)
-Use same password for the keystore as the one you'll use for the certificate.
2) Edit c:\AwareIm\Tomcat\conf\server.xml
remove the comment (<!-- and -->) before and after this connector and add path and password of the keystore:
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS"
keystoreFile="path-to-keystore\mykeystore" keystorePass="keystore-password"
/>
3) Create a local Certificate and Signing Request (CSR)
With these commands:
keytool -genkey -alias tomcat -keyalg RSA -keysize 2048 -keystore path-to-keystore\mykeystore
keytool -certreq -keyalg RSA -alias tomcat -keysize 2048 -file certreq.csr -keystore path-to-keystore\mykeystore
4) Submit the CSR (file certreq.csr) to the Certificate Authority (StartCom in this case) and get your trusted certificate. Copy/Paste certificate data in a text file (mycert.txt)
5) Get complementary certs (CA root certificate and class certificate). In this case:
http://www.startssl.com/certs/ca.pem
http://www.startssl.com/certs/sub.class1.server.ca.pem
6) Import the 2 StartCom Certificates:
keytool -import -alias startcom.ca -keystore path-to-keystore\mykeystore -trustcacerts -file "path-to-file\ca.pem"
keytool -import -alias startcom.ca.sub -keystore path-to-keystore\mykeystore -file "path-to-file\sub.class1.server.ca.pem"
7) Import your Trusted Certficate
keytool -import -alias tomcat -keystore path-to-keysotre\mykeystore -file "path-to-file\mycert.txt"
8-)This is optional (redirect http traffic to https):
Edit file c:\AwareIM\tomcat\conf\web.xml and add the code:
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
9) Restart AwareIM
Now, If you access to http://yourdomain.com, you must go to https://yourdomain.com
but I did not work to me, and after many hours trying it discovered the problem: I had no open port 443!!!. So the first lesson is: First of all open port 443 in firewall.
Well, I hope it works for you