Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
docs:ssl [2020-10-24 07:39] – [Web server redirection] Joseph Hogan | docs:ssl [2022-06-24 15:05] (current) – Tobias | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Using SSL with Friendica | + | ====== |
- | ====== ====== | + | ===== Disclaimer |
- | [[https:// | + | **This document has been updated in November 2016. SSL encryption is relevant for security. This means that recommended settings change fast. Keep your setup up to date and do not rely on this document being updated as fast as technologies change!** |
- | ====== Disclaimer ====== | + | ===== Intro ===== |
- | + | ||
- | **This document has been updated in November 2016. SSL encryption is relevant for security. This means that recommended settings change fast. Keep your setup up to date and do not rely on this document being updated as fast as technologies change!** | + | |
- | ====== Intro ====== | + | |
If you are running your own Friendica site, you may want to use SSL (https) to encrypt communication between servers and between yourself and your server. | If you are running your own Friendica site, you may want to use SSL (https) to encrypt communication between servers and between yourself and your server. | ||
- | There are basically two sorts of SSL certificates: | + | There are basically two sorts of SSL certificates: |
- | For this reason, we recommend to get a certificate signed by a CA. Normally, you have to pay for them - and they are valid for a limited period of time (e.g. a year or two). | + | For this reason, we recommend to get a certificate signed by a CA. Normally, you have to pay for them - and they are valid for a limited period of time (e.g. a year or two). |
There are ways to get a trusted certificate for free. | There are ways to get a trusted certificate for free. | ||
Line 20: | Line 17: | ||
===== Choose your domain name ===== | ===== Choose your domain name ===== | ||
- | Your SSL certificate will be valid for a domain or even only for a subdomain. Make your final decision about your domain resp. subdomain | + | Your SSL certificate will be valid for a domain or even only for a subdomain. Make your final decision about your domain resp. subdomain |
==== Shared hosts ==== | ==== Shared hosts ==== | ||
- | If your Friendica instance is running on a shared hosting platform, you should first check with your hosting provider. They have instructions for you on how to do it there. You can always order a paid certificate with your provider. They will either install it for you or provide an easy way to upload the certificate and the key via a web interface. With some providers, you have to send them your certificate. They need the certificate, | + | If your Friendica instance is running on a shared hosting platform, you should first check with your hosting provider. They have instructions for you on how to do it there. You can always order a paid certificate with your provider. They will either install it for you or provide an easy way to upload the certificate and the key via a web interface. With some providers, you have to send them your certificate. They need the certificate, |
==== Own server ==== | ==== Own server ==== | ||
- | If you run your own server, we recommend to check out the [[https:// | + | If you run your own server, we recommend to check out the [[https:// |
===== Web server settings ===== | ===== Web server settings ===== | ||
- | Visit the [[https:// | + | Visit the [[https:// |
+ | ===== Test your SSL settings ===== | ||
- | ==== Test your SSL settings ==== | + | When you are done, visit the test site [[https:// |
- | + | ||
- | When you are done, visit the test site [[https:// | + | |
===== Configure Friendica ===== | ===== Configure Friendica ===== | ||
Line 50: | Line 46: | ||
< | < | ||
- | | + | |
</ | </ | ||
+ | Add the following lines to the .htaccess file in the root folder of your Friendica instance (thanks to [[https:// | ||
- | Add the following lines to the .htaccess file in the root folder of your Friendica instance (thanks to [[https:// | ||
< | < | ||
- | + | | |
- | | + | RewriteCond %{SERVER_PORT} 80 |
- | RewriteCond %{SERVER_PORT} 80 | + | RewriteRule ^(.*)$ https:// |
- | RewriteRule ^(.*)$ https:// | + | |
</ | </ | ||
+ | With nginx, configure your server directive this way ([[https:// | ||
- | With nginx, configure your server directive this way ([[https:// | ||
< | < | ||
- | + | | |
- | | + | |
- | | + | |
- | | + | |
- | | + | } |
- | } | + | |
</ | </ | ||
- | |||
- | |||
==== SSL Settings ==== | ==== SSL Settings ==== | ||
In the Admin Settings, there are three SSL-related settings: | In the Admin Settings, there are three SSL-related settings: | ||
- | 1. **SSL link policy**: this affects how Friendica generates internal links. If your SSL installation was successful, we recommend | + | - **SSL link policy**: this affects how Friendica generates internal links. If your SSL installation was successful, we recommend |
- | + | - **Force SSL**: This forces all external links to HTTPS, which may solve Mixed-Content issues, but not all websites support HTTPS yet. Use at your own risk. | |
- | + | - **Verify SSL**: Enabling this will prevent Friendica to interact with self-signed SSL sites. We recommend you leave it on as a self-signed SSL certificate can be a vectorfor a man-in-the-middle attack. | |
- | ===== Configure Friendica ===== | + | |
- | + | ||
- | If you can successfully access your Friendica instance through https, there are a number of steps you can take to ensure your users will use SSL to access your instance. | + | |
- | + | ||
- | + | ||
- | ==== Web server redirection ==== | + | |
- | + | ||
- | This is the simplest way to enforce site-wide secure access. Every time a user tries to access any Friendica page by any mean (manual address bar entry or link), the web server issues a Permanent Redirect response with the secure protocol prepended to the requested URL. | + | |
- | + | ||
- | With Apache, enable the modules rewrite and ssl (with a shared hosting provider, this should be enabled already): | + | |
- | + | ||
- | < | + | |
- | sudo a2enmod rewrite ssl | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | Add the following lines to the .htaccess file in the root folder of your Friendica instance (thanks to [[https:// | + | |
- | < | + | |
- | + | ||
- | RewriteEngine On | + | |
- | RewriteCond %{SERVER_PORT} 80 | + | |
- | RewriteRule ^(.*)$ https:// | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | With nginx, configure your server directive this way ([[https:// | + | |
- | < | + | |
- | + | ||
- | server { | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | + | ||
- | ==== SSL Settings ==== | + | |
- | + | ||
- | In the Admin Settings, there are three SSL-related settings: | + | |
- | + | ||
- | 1. **SSL link policy**: this affects how Friendica generates internal links. If your SSL installation was successful, we recommend "Force all links to SSL" just in case your web server configuration can't be altered like described above. 2. **Force SSL**: This forces all external links to HTTPS, which may solve Mixed-Content issues, but not all websites support HTTPS yet. Use at your own risk. 3. **Verify SSL**: Enabling this will prevent Friendica to interact with self-signed SSL sites. We recommend you leave it on as a self-signed SSL certificate can be a vectorfor a man-in-the-middle attack. | + | |