HTTPS(Redirected from https)
HTTPS is an abbreviation for Hypertext Transfer Protocol Secure, a protocol for secure communication, supported by web servers (like Apache & nginx) and browsers. HTTPS layers Hypertext Transfer Protocol (HTTP) on top of the SSL/TLS protocol. WhyWhy?
How to
ObtainBuying or obtaining free SSL certificates today
Validating Your PurchaseSSL Certificate providers require some form of verification of you, your domain, and your ownership of your domain. CSR Generation — A Certificate Signing Request must be generated at your site. For example, on a hosting provider that uses Cpanel, the "SSL/TLS Manager" has a "Certificate Signing Requests" section. Approver Email — ssls.com asks for an "Approver Email" from a list of administration email addresses and Domain Registration email addresses. Choose one that you use, and receive the Domain Control Validation email, which contains a link and a "validation code". Click the link and enter the code to verify that you own the domain. Certificate Email — ssls.com send the certificate to the "Administrator Email" that you specified during the purchase process. This certificate is used in the process below. Let’s EncryptAlternatively you can use Let’s Encrypt. In order to obtain a certificate you need to use their client. Log into the machine hosting your website and install the client with git: git clone https://github.com/letsencrypt/letsencrypt cd letsencrypt ./letsencrypt-auto --help There are several ways we can proceed, for this example we shall simply obtain the certificates. In order to authenticate, the client will run its own server. Any server already running will conflict so we need to temporarily stop it: sudo systemctl stop nginx # or equivalent command ./letsencrypt-auto certonly --standalone --standalone-supported-challenges tls-sni-01 The client will start and then ask you to enter a list of domains you wish to use the certificate for. You could, for example, enter ManageWhen you're done with your purchase, you'll have one or more files for each certificate:
All of these files are usually X.509 format except the private key, which is RSA or other private key format. Command line openssl x509 -text -in snarfed.org.ssl.crt If your CA provided an intermediate cert, you'll need to provide it to your web server along with your own cert. For servers that only accept a single file, you'll need to concatenate the certs, e.g.: cat snarfed.org.ssl.crt sub.class1.server.ca.pem > snarfed.org.unified.ssl.crt As another example, it seems like this command line should verify that a cert is valid: openssl verify -verbose -CAfile ca.pem snarfed.org.unified.ssl.crt ...but User:snarfed.org gets this error: error 20 at 0 depth lookup:unable to get local issuer certificate You will get the "error 20" error above when openssl is unable to locate the root or intermediate certificates in your chain - if you are on Linux, or know where your OS stores the certificate list, you can run: openssl verify -verbose -CApath /etc/ssl/certs snarfed.org.unified.ssl.crt If you have gnutls command line tools installed, you can verify self-signed certs: certtool -e --infile snarfed.org.unified.ssl.crt
SetupThe IETF has a document with recommendations for Secure Use of TLS and DTLS. Mozilla has a great tool to build the SSL Configuration for various tools: Mozilla SSL Configuration Generator. https://cipherli.st is a quick cheatsheet for Apache, nginx and Lighttpd TLS configuration. ApacheApache is pretty easy. Here's a good how-to post. TL;DR: Put the certificate files somewhere your Apache user can read, then set the SSLCertificateKeyFile /home/ryan/.ssh/id_rsa-2048 SSLCertificateFile /home/ryan/www/snarfed.org.ssl.crt SSLCACertificateFile /home/ryan/www/sub.class1.server.ca.pem User:ShaneHudson.net - As well as the certificates and keys, it is also useful to have forward secrecy and HSTS. I used the following lines in httpd.conf, the articles I found them in are in the FAQs further below. This went from C to A+ on the SSL test.
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
App EngineIf you're serving on Google AppEngine's built-in If you're using the Java runtime on App Engine, add this stanza to your
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
...>
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
You may additionally want to send a HSTS header to further improve security. In java, the easiest way from a servlet running on AppEngine is to add this header to all responses when running on the production server.
import com.google.appengine.api.utils.SystemProperty;
...
if (SystemProperty.environment.value() ==
SystemProperty.Environment.Value.Production) {
// force ssl for six months.
response.addHeader("Strict-Transport-Security", "max-age=15768000");
}
If you also deliver static content, you may want to enable the HSTS header here as well. An example stanza within your
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
...
<static-files>
<include path="/static/**" >
<http-header name="Strict-Transport-Security" value="max-age=15768000"/>
...
If you're on a custom domain, you can use either SNI or a VIP. Details here. You'll need to upload your SSL cert files to the Google Apps control panel for your domain, then add and configure SNI or VIP slots in App Engine. nginxWe can setup nginx to listen on port 443 with our SSL sertificate quite easily:
server {
listen 443 ssl;
server_name example.org;
ssl_certificate /path/to/unified.crt;
ssl_certificate_key /path/to/my-private-decrypted.key;
//usual nginx config here like location blocks
}
For more detailed nginx config instructions see the page on nginx TestProductionQualys's SSL Server Test is an easy way to test the SSL cert on your live site. See e.g. brid.gy's report card, or for comparison jonnybarnes.uk gets slightly different results. shaaaaaaaaaaaaa.com will check if your SSL Cert using SHA-1 or SHA-2 and explains why it's becoming more important. [2] will test your web server's security header hardness and offers reasons why. You can use openssl s_client -connect snarfed.org:443 If your server uses SNI, you'll need to provide the hostname too: openssl s_client -servername www.brid.gy -connect www.brid.gy:443 Here's an example of debugging a single SSL issue:
Brand new StartSSL certificates may give an OCSP validation error for 6-24 hours after purchase. This seems to only affect Firefox and resolves itself when the certificate propagates to the validation server[3]. Firefox users can disable the check temporarily with Edit > Preferences > Advanced > Certificates > Validation, and uncheck "Use the Online Certificate Status Protocol" LocalWhen developing a website locally, it may be useful to be able to test the site via https. For example, when writing an OAuth client, some providers will not redirect to a page that does not use https. The easiest way to do this is to temporarily redirect your site to your own localhost (just for yourself) and use your site's cert. Just add a line like this to your hosts file: 127.0.0.1 snarfed.org This is obviously temporary, though. For a more permanent setup, you can either generate a self-signed SSL certificate for your testing domain (localhost, etc) or you can create your own SSL certificate authority and sign the certificate with that. To assist with this, aaronpk has created an "IndieWebCamp" root authority that can sign certificates for domains ending in ".dev". You can add a line to your hosts file for your test domain such as 127.0.0.1 mydomain.dev And then you can use the IndieWebCamp certificate authority to generate an SSL cert for it. RenewA few things to be aware of when you need to renew your certificates. Because all of the browsers now share lists of certificates that are invalid and/or broken as part of OCSP stapling you should renew your certificate at least two days prior to it expiring and then update your server with the certificate at least a day before. This allows the various OCSP lists to update before you touch your server - if you do not you may get some customers whose browsers have an older list and your certificate will not pass their OCSP check, which is different than it being on the revocation list. Tricks, tips, best practices
Posts about HTTPS
IndieMark LevelsProposed IndieMark Levels of recommended support for HTTPS on your own website, as part of a security component
Level 1 securityLevel 1 - Don't do the wrong thing. (what's the minimal "not wrong thing"?). Possible reasonable behaviors:
Why?
IndieWeb Examples
Level 2 securityLevel 2 - Secure admin of your site - support https for your login/admin UI/page(s) with a self-signed certificate.
Why?
How to
N.B. useful htaccess file checker: htaccess checker - let's you paste in your htaccess file and test URL flow through it using sample URLs.
IndieWeb Examples
Level 3 securityLevel 3 - Serve https optionally on all your pages - provide your front-end over both http and https with a cert from a trusted CA, but not necessarily external content, thus you might still get mixed-content warnings sometimes. Why?
IndieWeb Examples
IndieWeb Examples with http to https redirects (that still need fixing of mixed content warnings) - we explicitly recommend not redirecting your http pages to https unless you've ensured you have no mixed-content warnings.
Level 4 securityLevel 4 - Lock icon or better when serving https - be sure there's at least a lock icon next to the https in the address bar. Serve everything (home page, permalinks, images etc.) over https when the user requests https. Eliminate mixed-content warnings (e.g. triangle with exclamation mark inside next to https in the URL bar). Why?
IndieWeb Examples in rough order of implementation
Level 5 securityLevel 5 - Redirect everything to https - send redirects from http -> https. I.e. your pages automatically always get at least a lock icon in the browser address bar (and no warnings). Why?
IndieWeb Examples in rough order of implementation
Check the browser's address bar where your URL is displayed and make sure:
Why is my site running so slowly?
Why am I only A not A+?
Level 6 securityLevel 6 - Correct ciphers, support forward secrecy, etc. per https://www.ssllabs.com/ssltest/ (all previous levels required, i.e. document method of http to https redirection) Why?
IndieWeb Examples
CriticismLegacy Software and SNI SupportA server has an IP address. It used to be that each server would host one website (domain) in HTTP/1. Then HTTP/1.1 introduced the Host header which allowed a server to host multiple domains. However, the connection needs to be encrypted before the Host header can be sent. So which certificate should the server send initially? When the wrong one is chosen we get issues. The solution to this problem is called Server Name Indication. SNI is supported by all modern browsers and cryptography libraries. OpenSSL is one of the most popular and has supported SNI since 2010 for example. However, we can run into issues when older software tries to interact with your site: http://indiewebcamp.com/irc/2015-12-06/line/1449416119493 General X509 Criticism
Maintenance tax and site fragilityAdding HTTPS to your site adds the extra maintenance tax of HTTPS certificate renewal (and updating). As a result, if you fail to do this, or get it wrong, your site goes down. Evidence:
Let’s Encrypt are trying to fix this by making updating TLS certificates an automated process via their Let’s Encrypt client. Related
SessionsSessions at IndieWebCamps about https:
See Also |



















