Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
4.8 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. Using SSL with Friendica
  2. =====================================
  3. * [Home](help)
  4. ## Disclaimer
  5. **This document has been updated in November 2016.
  6. SSL encryption is relevant for security.
  7. This means that recommended settings change fast.
  8. Keep your setup up to date and do not rely on this document being updated as fast as technologies change!**
  9. ## Intro
  10. 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.
  11. There are basically two sorts of SSL certificates: Self-signed certificates and certificates signed by a certificate authority (CA).
  12. Technically, both provide the same valid encryption.
  13. There is a problem with self-signed certificates though:
  14. They are neither installed in browsers nor on other servers.
  15. That is why they provoke warnings about "mistrusted certificates".
  16. This is confusing and disturbing.
  17. For this reason, we recommend to get a certificate signed by a CA.
  18. Normally, you have to pay for them - and they are valid for a limited period of time (e.g. a year or two).
  19. There are ways to get a trusted certificate for free.
  20. ## Choose your domain name
  21. Your SSL certificate will be valid for a domain or even only for a subdomain.
  22. Make your final decision about your domain resp. subdomain *before* ordering the certificate.
  23. Once you have it, changing the domain name means getting a new certificate.
  24. ### Shared hosts
  25. If your Friendica instance is running on a shared hosting platform, you should first check with your hosting provider.
  26. They have instructions for you on how to do it there.
  27. You can always order a paid certificate with your provider.
  28. They will either install it for you or provide an easy way to upload the certificate and the key via a web interface.
  29. With some providers, you have to send them your certificate.
  30. They need the certificate, the key and the CA's intermediate certificate.
  31. To be sure, send those three files.
  32. **You should send them to your provider via an encrypted channel!**
  33. ### Own server
  34. If you run your own server, we recommend to check out the ["Let's Encrypt" initiative](
  35. Not only do they offer free SSL certificates, but also a way to automate their renewal.
  36. You need to install a client software on your server to use it.
  37. Instructions for the official client are [here](
  38. Depending on your needs, you might want to look at the [list of alternative letsencrypt clients](
  39. ## Web server settings
  40. Visit the [Mozilla's wiki]( for instructions on how to configure a secure webserver.
  41. They provide recommendations for [different web servers](
  42. ## Test your SSL settings
  43. When you are done, visit the test site [SSL Labs]( to have them check if you succeeded.
  44. ## Configure Friendica
  45. 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.
  46. ### Web server redirection
  47. This is the simplest way to enforce site-wide secure access.
  48. 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.
  49. With Apache, enable the modules rewrite and ssl (with a shared hosting provider, this should be enabled already):
  50. sudo a2enmod rewrite ssl
  51. Add the following lines to the .htaccess file in the root folder of your Friendica instance (thanks to [url=]AlfredSK[/url]):
  52. RewriteEngine On
  53. RewriteCond %{SERVER_PORT} 80
  54. RewriteRule ^(.*)$ https://your.friendica.domain/$1 [R=301,L]
  55. With nginx, configure your server directive this way ([documentation](
  56. server {
  57. listen 80;
  58. server_name your.friendica.domain;
  59. return 301 https://$server_name$request_uri;
  60. }
  61. ### SSL Settings
  62. In the Admin Settings, there are three SSL-related settings:
  63. 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.
  64. 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.
  65. 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.