Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have stunnel4 installed on Ubuntu Server 11.10. I have apache installed from the repositories. I have some programs installed such as ownCloud or sitebar. When I visit their web pages over the Internet using addresses like, if I then click on a link within the web page that appears, it takes me to a http address such as and the page appears white.

I have to always keep changing the URLs to https. How can I correct this behaviour?

Th site installed on the server is located at for example, http://myserver/owncloud, but I am taking it through stunnel to give it some security when accessing it online.

share|improve this question
From its description it looks like that stunnel4 encrypts traffic between the server and client, without touching the actual contents of the message (i.e. rewriting URLs from http -> https). Can't you create a proper setup with SSL for Apache? – Lekensteyn Feb 11 '12 at 17:48
Thank you, I will look into this. Apache documentation on Ubuntu says "The default HTTPS configuration will use a certificate and key generated by the ssl-cert package. They are good for testing, but the auto-generated certificate and key should be replaced by a certificate specific to the site or server". Is it therefore not safe for me to just use the key that comes with or is generated by it? – nLinked Feb 11 '12 at 18:44
Thank you, you have answered my question, this is exactly what I need. But I can't mark as answer. If you can Answer it using button below I will mark it answered :) – nLinked Feb 11 '12 at 19:01
up vote 1 down vote accepted

From the description of the stunnel4 package, it looks like that the application just acts as a secured messenger: at the server side data is encrypted, at the client side it's unencrypted without touching the message contents itself (like rewriting http:// URLs to https://). Since you control the Apache server, you are recommended to configure SSL on Apache. For example, see How to easily deploy HTTPS in ubuntu 10.04?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.