Follow the following steps to export SSL certificate from IIS to secure tunnel using Openssl:
1) First install the certificate in the local store using certificate manager.
2) If you have to use it for IIS then please see to it that it appears in the personal store under the local computer.
3) Export the certificate in pkcs12 format on your C drive. Please see to it that the private keys are also exported.
4) Go to command prompt and then do the following
C:\Program Files\Ensim\Webppliance\stunnel\w2k>openssl pkcs12 -nodes -in c:\pkcs.pfx -info -out stunell1.pem
Where pkcs.pfx in the exported certificate and stunell1.pem is the certificate the stunnel will use. When you run this command then it will ask you for the password please provide the password that you gave while exporting the certificate. It will save the file.
5) Backup the C:\Program Files\Ensim\Sitedata\webppliance\conf\ssl\ssl.pem by some other name say stunnel.pem.org.
6) Copy the stunell1.pem that was created by you using openssl in the same directory and rename it to stunnel.pem
7) Restart the Virtualhosting service.
Now when you view the certificate you will find that your certificate is being served.
Note: Please note that in this process we have disabled des and 3des protection as during the import if you enable it then on starting the stunnel process it actually prompts you for the password. Since the service runs in background mode it will not start due to the above condition.