cloudflare CDN ip range

原文:https://www.cloudflare.com/ips/

 

IP Ranges

Some applications or host providers might find it handy to know about Cloudflare’s IPs. This page is intended to be the definitive source of Cloudflare’s current IP ranges. IPv4

IPv4

103.21.244.0/22
103.22.200.0/22
103.31.4.0/22
104.16.0.0/12
108.162.192.0/18
131.0.72.0/22
141.101.64.0/18
162.158.0.0/15
172.64.0.0/13
173.245.48.0/20
188.114.96.0/20
190.93.240.0/20
197.234.240.0/22
198.41.128.0/17
199.27.128.0/21
IPv6

2400:cb00::/32
2405:8100::/32
2405:b500::/32
2606:4700::/32
2803:f800::/32
2c0f:f248::/32
2a06:98c0::/29

ug nx linux

NX11 Document+ISO SSQ

magnet:?xt=urn:btih:D26E0924B372FD5CB505AF9FAA6451644A31A7B1&tr=http%3A%2F%2Fbt3.t-ru.org%2Fann%3Fmagnet

NX10

magnet:?xt=urn:btih:09fc05f5664948853698910bda758b75b3f350e3&dn=SIEMENS.PLM.NX.10.0.0.LINUX64-SSQ

Cerbot User Guide

原文:https://certbot.eff.org/docs/using.html#getting-certificates

System Requirements

The Let’s Encrypt Client presently only runs on Unix-ish OSes that include Python 2.6 or 2.7; Python 3.x support will hopefully be added in the future. The client requires root access in order to write to /etc/letsencrypt, /var/log/letsencrypt, /var/lib/letsencrypt; to bind to ports 80 and 443 (if you use the standalone plugin) and to read and modify webserver configurations (if you use the apache or nginx plugins). If none of these apply to you, it is theoretically possible to run without root privileges, but for most users who want to avoid running an ACME client as root, either letsencrypt-nosudo or simp_le are more appropriate choices.

The Apache plugin currently requires OS with augeas version 1.0; currently it supports modern OSes based on Debian, Fedora, SUSE, Gentoo and Darwin.

Getting Certbot

Certbot is packaged for many common operating systems and web servers. Check whethercertbot (or letsencrypt) is packaged for your web server’s OS by visiting certbot.eff.org, where you will also find the correct installation instructions for your system.

Note

Unless you have very specific requirements, we kindly suggest that you use the Certbot packages provided by your package manager (see certbot.eff.org). If such packages are not available, we recommend using certbot-auto, which automates the process of installing Certbot on your system.

The certbot script on your web server might be named letsencrypt if your system uses an older package, or certbot-auto if you used an alternate installation method. Throughout the docs, whenever you see certbot, swap in the correct name as needed.

Other installation methods

If you are offline or your operating system doesn’t provide a package, you can use an alternate method fo install certbot.

Certbot-Auto

The certbot-auto wrapper script installs Certbot, obtaining some dependencies from your web server OS and putting others in a python virtual environment. You can download and run it as follows:

user@webserver:~$ wget https://dl.eff.org/certbot-auto
user@webserver:~$ chmod a+x ./certbot-auto
user@webserver:~$ ./certbot-auto --help

Hint

The certbot-auto download is protected by HTTPS, which is pretty good, but if you’d like to double check the integrity of the certbot-auto script, you can use these steps for verification before running it:

user@server:~$ wget -N https://dl.eff.org/certbot-auto.asc
user@server:~$ gpg2 --recv-key A2CFB51FA275A7286234E7B24D17C995CD9775F2
user@server:~$ gpg2 --trusted-key 4D17C995CD9775F2 --verify certbot-auto.asc certbot-auto

The certbot-auto command updates to the latest client release automatically. Sincecertbot-auto is a wrapper to certbot, it accepts exactly the same command line flags and arguments. For more information, see Certbot command-line options.

Running with Docker

Docker is an amazingly simple and quick way to obtain a certificate. However, this mode of operation is unable to install certificates or configure your webserver, because our installer plugins cannot reach your webserver from inside the Docker container.

Most users should use the operating system packages (see instructions at certbot.eff.org) or, as a fallback, certbot-auto. You should only use Docker if you are sure you know what you are doing and have a good reason to do so.

You should definitely read the Where are my certificates? section, in order to know how to manage the certs manually. Our ciphersuites page provides some information about recommended ciphersuites. If none of these make much sense to you, you should definitely use the certbot-auto method, which enables you to use installer plugins that cover both of those hard topics.

If you’re still not convinced and have decided to use this method, from the server that the domain you’re requesting a cert for resolves to, install Docker, then issue the following command:

sudo docker run -it --rm -p 443:443 -p 80:80 --name certbot 
            -v "/etc/letsencrypt:/etc/letsencrypt" 
            -v "/var/lib/letsencrypt:/var/lib/letsencrypt" 
            quay.io/letsencrypt/letsencrypt:latest certonly

Running Certbot with the certonly command will obtain a certificate and place it in the directory /etc/letsencrypt/live on your system. Because Certonly cannot install the certificate from within Docker, you must install the certificate manually according to the procedure recommended by the provider of your webserver.

For more information about the layout of the /etc/letsencrypt directory, see Where are my certificates?.

Operating System Packages

FreeBSD

  • Port: cd /usr/ports/security/py-certbot && make install clean
  • Package: pkg install py27-certbot

OpenBSD

  • Port: cd /usr/ports/security/letsencrypt/client && make install clean
  • Package: pkg_add letsencrypt

Arch Linux

sudo pacman -S certbot

Debian

If you run Debian Stretch or Debian Sid, you can install certbot packages.

sudo apt-get update
sudo apt-get install certbot python-certbot-apache

If you don’t want to use the Apache plugin, you can omit the python-certbot-apache package.

Packages exist for Debian Jessie via backports. First you’ll have to follow the instructions athttp://backports.debian.org/Instructions/ to enable the Jessie backports repo, if you have not already done so. Then run:

sudo apt-get install letsencrypt python-letsencrypt-apache -t jessie-backports

Fedora

sudo dnf install letsencrypt

Gentoo

The official Certbot client is available in Gentoo Portage. If you want to use the Apache plugin, it has to be installed separately:

emerge -av app-crypt/letsencrypt
emerge -av app-crypt/letsencrypt-apache

Currently, only the Apache plugin is included in Portage. However, if you Warning! You can use Layman to add the mrueg overlay which does include a package for the Certbot Nginx plugin, however, this plugin is known to be buggy and should only be used with caution after creating a backup up your Nginx configuration. We strongly recommend you use the app-crypt/letsencrypt package instead until the Nginx plugin is ready.

emerge -av app-portage/layman
layman -S
layman -a mrueg
emerge -av app-crypt/letsencrypt-nginx

When using the Apache plugin, you will run into a “cannot find a cert or key directive” error if you’re sporting the default Gentoo httpd.conf. You can fix this by commenting out two lines in/etc/apache2/httpd.conf as follows:

Change

<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>

to

#<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
#</IfDefine>

For the time being, this is the only way for the Apache plugin to recognise the appropriate directives when installing the certificate. Note: this change is not required for the other plugins.

Other Operating Systems

OS packaging is an ongoing effort. If you’d like to package Certbot for your distribution of choice please have a look at the Packaging Guide.

Installing from source

Installation from source is only supported for developers and the whole process is described in the Developer Guide.

Warning

Please do not use python setup.py install or python pip install .. Please do not attempt the installation commands as superuser/root and/or without virtual environment, e.g.sudo python setup.py install, sudo pip install, sudo ./venv/bin/.... These modes of operation might corrupt your operating system and are not supported by the Certbot team!

Getting certificates

The Certbot client supports a number of different “plugins” that can be used to obtain and/or install certificates. Plugins that can obtain a cert are called “authenticators” and can be used with the “certonly” command. Plugins that can install a cert are called “installers”. Plugins that do both can be used with the “certbot run” command, which is the default.

Plugin Auth Inst Notes
apache Y Y Automates obtaining and installing a cert with Apache 2.4 on Debian-based distributions with libaugeas0 1.0+.
webroot Y N Obtains a cert by writing to the webroot directory of an already running webserver.
standalone Y N Uses a “standalone” webserver to obtain a cert. Requires port 80 or 443 to be available. This is useful on systems with no webserver, or when direct integration with the local webserver is not supported or not desired.
manual Y N Helps you obtain a cert by giving you instructions to perform domain validation yourself.
nginx Y Y Very experimental and not included in certbot-auto.

There are also many third-party-plugins available.

Apache

If you’re running Apache 2.4 on a Debian-based OS with version 1.0+ of the libaugeas0 package available, you can use the Apache plugin. This automates both obtaining and installing certs on an Apache webserver. To specify this plugin on the command line, simply include --apache.

Webroot

If you’re running a local webserver for which you have the ability to modify the content being served, and you’d prefer not to stop the webserver during the certificate issuance process, you can use the webroot plugin to obtain a cert by including certonly and --webroot on the command line. In addition, you’ll need to specify --webroot-path or -w with the top-level directory (“web root”) containing the files served by your webserver. For example, --webroot-path /var/www/html or --webroot-path /usr/share/nginx/html are two common webroot paths.

If you’re getting a certificate for many domains at once, the plugin needs to know where each domain’s files are served from, which could potentially be a separate directory for each domain. When requesting a certificate for multiple domains, each domain will use the most recently specified --webroot-path. So, for instance,

certbot certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net

would obtain a single certificate for all of those names, using the /var/www/example webroot directory for the first two, and /var/www/other for the second two.

The webroot plugin works by creating a temporary file for each of your requested domains in${webroot-path}/.well-known/acme-challenge. Then the Let’s Encrypt validation server makes HTTP requests to validate that the DNS for each requested domain resolves to the server running certbot. An example request made to your web server would look like:

66.133.109.36 - - [05/Jan/2016:20:11:24 -0500] "GET /.well-known/acme-challenge/HGr8U1IeTW4kY_Z6UIyaakzOkyQgPr_7ArlLgtZE8SX HTTP/1.1" 200 87 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)"

Note that to use the webroot plugin, your server must be configured to serve files from hidden directories. If /.well-known is treated specially by your webserver configuration, you might need to modify the configuration to ensure that files inside /.well-known/acme-challenge are served by the webserver.

Standalone

To obtain a cert using a “standalone” webserver, you can use the standalone plugin by includingcertonly and --standalone on the command line. This plugin needs to bind to port 80 or 443 in order to perform domain validation, so you may need to stop your existing webserver. To control which port the plugin uses, include one of the options shown below on the command line.

  • --standalone-supported-challenges http-01 to use port 80
  • --standalone-supported-challenges tls-sni-01 to use port 443

The standalone plugin does not rely on any other server software running on the machine where you obtain the certificate. It must still be possible for that machine to accept inbound connections from the Internet on the specified port using each requested domain name.

Manual

If you’d like to obtain a cert running certbot on a machine other than your target webserver or perform the steps for domain validation yourself, you can use the manual plugin. While hidden from the UI, you can use the plugin to obtain a cert by specifying certonly and --manual on the command line. This requires you to copy and paste commands into another terminal session, which may be on a different computer.

Nginx

In the future, if you’re running Nginx you will hopefully be able to use this plugin to automatically obtain and install your certificate. The Nginx plugin is still experimental, however, and is not installed with certbot-auto. If installed, you can select this plugin on the command line by including --nginx.

Third-party plugins

There are also a number of third-party plugins for the client, provided by other developers. Many are beta/experimental, but some are already in widespread use:

Plugin Auth Inst Notes
plesk Y Y Integration with the Plesk web hosting tool
haproxy Y Y Integration with the HAProxy load balancer
s3front Y Y Integration with Amazon CloudFront distribution of S3 buckets
gandi Y Y Integration with Gandi’s hosting products and API
varnish Y N Obtain certs via a Varnish server
external Y N A plugin for convenient scripting (See also ticket 2782)
icecast N Y Deploy certs to Icecast 2 streaming media servers
pritunl N Y Install certs in pritunl distributed OpenVPN servers
proxmox N Y Install certs in Proxmox Virtualization servers
postfix N Y STARTTLS Everywhere is becoming a Certbot Postfix/Exim plugin

If you’re interested, you can also write your own plugin.

Renewing certificates

Note

Let’s Encrypt CA issues short-lived certificates (90 days). Make sure you renew the certificates at least once in 3 months.

The certbot client now supports a renew action to check all installed certificates for impending expiry and attempt to renew them. The simplest form is simply

certbot renew

This will attempt to renew any previously-obtained certificates that expire in less than 30 days. The same plugin and options that were used at the time the certificate was originally issued will be used for the renewal attempt, unless you specify other plugins or options.

You can also specify hooks to be run before or after a certificate is renewed. For example, if you want to use the standalone plugin to renew your certificates, you may want to use a command like

certbot renew --standalone --pre-hook "service nginx stop" --post-hook "service nginx start"

This will stop Nginx so standalone can bind to the necessary ports and then restart Nginx after the plugin is finished. The hooks will only be run if a certificate is due for renewal, so you can run this command frequently without unnecessarily stopping your webserver. More information about renewal hooks can be found by running certbot --help renew.

If you’re sure that this command executes successfully without human intervention, you can add the command to crontab (since certificates are only renewed when they’re determined to be near expiry, the command can run on a regular basis, like every week or every day). In that case, you are likely to want to use the -q or --quiet quiet flag to silence all output except errors.

The --force-renew flag may be helpful for automating renewal; it causes the expiration time of the certificate(s) to be ignored when considering renewal, and attempts to renew each and every installed certificate regardless of its age. (This form is not appropriate to run daily because each certificate will be renewed every day, which will quickly run into the certificate authority rate limit.)

Note that options provided to certbot renew will apply to every certificate for which renewal is attempted; for example, certbot renew --rsa-key-size 4096 would try to replace every near-expiry certificate with an equivalent certificate using a 4096-bit RSA public key. If a certificate is successfully renewed using specified options, those options will be saved and used for future renewals of that certificate.

An alternative form that provides for more fine-grained control over the renewal process (while renewing specified certificates one at a time), is certbot certonly with the complete set of subject domains of a specific certificate specified via -d flags. You may also want to include the -n or --noninteractive flag to prevent blocking on user input (which is useful when running the command from cron).

certbot certonly -n -d example.com -d www.example.com

(All of the domains covered by the certificate must be specified in this case in order to renew and replace the old certificate rather than obtaining a new one; don’t forget any www. domains! Specifying a subset of the domains creates a new, separate certificate containing only those domains, rather than replacing the original certificate.) The certonly form attempts to renew one individual certificate.

Please note that the CA will send notification emails to the address you provide if you do not renew certificates that are about to expire.

Certbot is working hard on improving the renewal process, and we apologize for any inconveniences you encounter in integrating these commands into your individual environment.

Certbot command-line options

Certbot supports a lot of command line options. Here’s the full list, from certbot --help all:

usage: 
  certbot [SUBCOMMAND] [options] [-d domain] [-d domain] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
it will attempt to use a webserver both for obtaining and installing the
cert. Major SUBCOMMANDS are:

  (default) run        Obtain & install a cert in your current webserver
  certonly             Obtain cert, but do not install it (aka "auth")
  install              Install a previously obtained cert in a server
  renew                Renew previously obtained certs that are near expiry
  revoke               Revoke a previously obtained certificate
  register             Perform tasks related to registering with the CA
  rollback             Rollback server configuration changes made during install
  config_changes       Show changes made to server config during installation
  plugins              Display information about installed plugins

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_FILE, --config CONFIG_FILE
                        config file path (default: None)
  -v, --verbose         This flag can be used multiple times to incrementally
                        increase the verbosity of output, e.g. -vvv. (default:
                        -3)
  -t, --text            Use the text output instead of the curses UI.
                        (default: False)
  -n, --non-interactive, --noninteractive
                        Run without ever asking for user input. This may
                        require additional command line flags; the client will
                        try to explain which ones are required if it finds one
                        missing (default: False)
  --dialog              Run using dialog (default: False)
  --dry-run             Perform a test run of the client, obtaining test
                        (invalid) certs but not saving them to disk. This can
                        currently only be used with the 'certonly' and 'renew'
                        subcommands. Note: Although --dry-run tries to avoid
                        making any persistent changes on a system, it is not
                        completely side-effect free: if used with webserver
                        authenticator plugins like apache and nginx, it makes
                        and then reverts temporary config changes in order to
                        obtain test certs, and reloads webservers to deploy
                        and then roll back those changes. It also calls --pre-
                        hook and --post-hook commands if they are defined
                        because they may be necessary to accurately simulate
                        renewal. --renew-hook commands are not called.
                        (default: False)
  --register-unsafely-without-email
                        Specifying this flag enables registering an account
                        with no email address. This is strongly discouraged,
                        because in the event of key loss or account compromise
                        you will irrevocably lose access to your account. You
                        will also be unable to receive notice about impending
                        expiration or revocation of your certificates. Updates
                        to the Subscriber Agreement will still affect you, and
                        will be effective 14 days after posting an update to
                        the web site. (default: False)
  --update-registration
                        With the register verb, indicates that details
                        associated with an existing registration, such as the
                        e-mail address, should be updated, rather than
                        registering a new account. (default: False)
  -m EMAIL, --email EMAIL
                        Email used for registration and recovery contact.
                        (default: None)
  -d DOMAIN, --domains DOMAIN, --domain DOMAIN
                        Domain names to apply. For multiple domains you can
                        use multiple -d flags or enter a comma separated list
                        of domains as a parameter. (default: [])
  --user-agent USER_AGENT
                        Set a custom user agent string for the client. User
                        agent strings allow the CA to collect high level
                        statistics about success rates by OS and plugin. If
                        you wish to hide your server OS version from the Let's
                        Encrypt server, set this to "". (default: None)

automation:
  Arguments for automating execution & other tweaks

  --keep-until-expiring, --keep, --reinstall
                        If the requested cert matches an existing cert, always
                        keep the existing one until it is due for renewal (for
                        the 'run' subcommand this means reinstall the existing
                        cert) (default: False)
  --expand              If an existing cert covers some subset of the
                        requested names, always expand and replace it with the
                        additional names. (default: False)
  --version             show program's version number and exit
  --force-renewal, --renew-by-default
                        If a certificate already exists for the requested
                        domains, renew it now, regardless of whether it is
                        near expiry. (Often --keep-until-expiring is more
                        appropriate). Also implies --expand. (default: False)
  --allow-subset-of-names
                        When performing domain validation, do not consider it
                        a failure if authorizations can not be obtained for a
                        strict subset of the requested domains. This may be
                        useful for allowing renewals for multiple domains to
                        succeed even if some domains no longer point at this
                        system. This option cannot be used with --csr.
                        (default: False)
  --agree-tos           Agree to the ACME Subscriber Agreement (default:
                        False)
  --account ACCOUNT_ID  Account ID to use (default: None)
  --duplicate           Allow making a certificate lineage that duplicates an
                        existing one (both can be renewed in parallel)
                        (default: False)
  --os-packages-only    (letsencrypt-auto only) install OS package
                        dependencies and then stop (default: False)
  --no-self-upgrade     (letsencrypt-auto only) prevent the letsencrypt-auto
                        script from upgrading itself to newer released
                        versions (default: False)
  -q, --quiet           Silence all output except errors. Useful for
                        automation via cron. Implies --non-interactive.
                        (default: False)

testing:
  The following flags are meant for testing purposes only! Do NOT change
  them, unless you really know what you're doing!

  --debug               Show tracebacks in case of errors, and allow
                        letsencrypt-auto execution on experimental platforms
                        (default: False)
  --no-verify-ssl       Disable SSL certificate verification. (default: False)
  --tls-sni-01-port TLS_SNI_01_PORT
                        Port number to perform tls-sni-01 challenge. Boulder
                        in testing mode defaults to 5001. (default: 443)
  --http-01-port HTTP01_PORT
                        Port used in the SimpleHttp challenge. (default: 80)
  --break-my-certs      Be willing to replace or renew valid certs with
                        invalid (testing/staging) certs (default: False)
  --test-cert, --staging
                        Use the staging server to obtain test (invalid) certs;
                        equivalent to --server https://acme-
                        staging.api.letsencrypt.org/directory (default: False)

security:
  Security parameters & server settings

  --rsa-key-size N      Size of the RSA key. (default: 2048)
  --must-staple         Adds the OCSP Must Staple extension to the
                        certificate. Autoconfigures OCSP Stapling for
                        supported setups (Apache version >= 2.3.3 ). (default:
                        False)
  --redirect            Automatically redirect all HTTP traffic to HTTPS for
                        the newly authenticated vhost. (default: None)
  --no-redirect         Do not automatically redirect all HTTP traffic to
                        HTTPS for the newly authenticated vhost. (default:
                        None)
  --hsts                Add the Strict-Transport-Security header to every HTTP
                        response. Forcing browser to always use SSL for
                        the domain. Defends against SSL Stripping. (default:
                        False)
  --no-hsts             Do not automatically add the Strict-Transport-Security
                        header to every HTTP response. (default: False)
  --uir                 Add the "Content-Security-Policy: upgrade-insecure-
                        requests" header to every HTTP response. Forcing the
                        browser to use https:// for every http:// resource.
                        (default: None)
  --no-uir              Do not automatically set the "Content-Security-Policy:
                        upgrade-insecure-requests" header to every HTTP
                        response. (default: None)
  --staple-ocsp         Enables OCSP Stapling. A valid OCSP response is
                        stapled to the certificate that the server offers
                        during TLS. (default: None)
  --no-staple-ocsp      Do not automatically enable OCSP Stapling. (default:
                        None)
  --strict-permissions  Require that all configuration files are owned by the
                        current user; only needed if your config is somewhere
                        unsafe like /tmp/ (default: False)

renew:
  The 'renew' subcommand will attempt to renew all certificates (or more
  precisely, certificate lineages) you have previously obtained if they are
  close to expiry, and print a summary of the results. By default, 'renew'
  will reuse the options used to create obtain or most recently successfully
  renew each certificate lineage. You can try it with `--dry-run` first. For
  more fine-grained control, you can renew individual lineages with the
  `certonly` subcommand. Hooks are available to run commands before and
  after renewal; see https://certbot.eff.org/docs/using.html#renewal for
  more information on these.

  --pre-hook PRE_HOOK   Command to be run in a shell before obtaining any
                        certificates. Intended primarily for renewal, where it
                        can be used to temporarily shut down a webserver that
                        might conflict with the standalone plugin. This will
                        only be called if a certificate is actually to be
                        obtained/renewed. (default: None)
  --post-hook POST_HOOK
                        Command to be run in a shell after attempting to
                        obtain/renew certificates. Can be used to deploy
                        renewed certificates, or to restart any servers that
                        were stopped by --pre-hook. This is only run if an
                        attempt was made to obtain/renew a certificate.
                        (default: None)
  --renew-hook RENEW_HOOK
                        Command to be run in a shell once for each
                        successfully renewed certificate.For this command, the
                        shell variable $RENEWED_LINEAGE will point to
                        theconfig live subdirectory containing the new certs
                        and keys; the shell variable $RENEWED_DOMAINS will
                        contain a space-delimited list of renewed cert domains
                        (default: None)
  --disable-hook-validation
                        Ordinarily the commands specified for --pre-hook
                        /--post-hook/--renew-hook will be checked for
                        validity, to see if the programs being run are in the
                        $PATH, so that mistakes can be caught early, even when
                        the hooks aren't being run just yet. The validation is
                        rather simplistic and fails if you use more advanced
                        shell constructs, so you can use this switch to
                        disable it. (default: True)

certonly:
  Options for modifying how a cert is obtained

  --csr CSR             Path to a Certificate Signing Request (CSR) in DER
                        format; note that the .csr file *must* contain a
                        Subject Alternative Name field for each domain you
                        want certified. Currently --csr only works with the
                        'certonly' subcommand' (default: None)

install:
  Options for modifying how a cert is deployed

revoke:
  Options for revocation of certs

rollback:
  Options for reverting config changes

  --checkpoints N       Revert configuration N number of checkpoints.
                        (default: 1)

plugins:
  Plugin options

  --init                Initialize plugins. (default: False)
  --prepare             Initialize and prepare plugins. (default: False)
  --authenticators      Limit to authenticator plugins only. (default: None)
  --installers          Limit to installer plugins only. (default: None)

config_changes:
  Options for showing a history of config changes

  --num NUM             How many past revisions you want to be displayed
                        (default: None)

paths:
  Arguments changing execution paths & servers

  --cert-path CERT_PATH
                        Path to where cert is saved (with auth --csr),
                        installed from or revoked. (default: None)
  --key-path KEY_PATH   Path to private key for cert installation or
                        revocation (if account key is missing) (default: None)
  --fullchain-path FULLCHAIN_PATH
                        Accompanying path to a full certificate chain (cert
                        plus chain). (default: None)
  --chain-path CHAIN_PATH
                        Accompanying path to a certificate chain. (default:
                        None)
  --config-dir CONFIG_DIR
                        Configuration directory. (default: /etc/letsencrypt)
  --work-dir WORK_DIR   Working directory. (default: /var/lib/letsencrypt)
  --logs-dir LOGS_DIR   Logs directory. (default: /var/log/letsencrypt)
  --server SERVER       ACME Directory Resource URI. (default:
                        https://acme-v01.api.letsencrypt.org/directory)

plugins:
  Certbot client supports an extensible plugins architecture. See 'certbot
  plugins' for a list of all installed plugins and their names. You can
  force a particular plugin by setting options provided below. Running
  --help <plugin_name> will list flags specific to that plugin.

  -a AUTHENTICATOR, --authenticator AUTHENTICATOR
                        Authenticator plugin name. (default: None)
  -i INSTALLER, --installer INSTALLER
                        Installer plugin name (also used to find domains).
                        (default: None)
  --configurator CONFIGURATOR
                        Name of the plugin that is both an authenticator and
                        an installer. Should not be used together with
                        --authenticator or --installer. (default: None)
  --apache              Obtain and install certs using Apache (default: False)
  --nginx               Obtain and install certs using Nginx (default: False)
  --standalone          Obtain certs using a "standalone" webserver. (default:
                        False)
  --manual              Provide laborious manual instructions for obtaining a
                        cert (default: False)
  --webroot             Obtain certs by placing files in a webroot directory.
                        (default: False)

standalone:
  Automatically use a temporary webserver

  --standalone-supported-challenges STANDALONE_SUPPORTED_CHALLENGES
                        Supported challenges. Preferred in the order they are
                        listed. (default: tls-sni-01,http-01)

manual:
  Manually configure an HTTP server

  --manual-test-mode    Test mode. Executes the manual command in subprocess.
                        (default: False)
  --manual-public-ip-logging-ok
                        Automatically allows public IP logging. (default:
                        False)

nginx:
  Nginx Web Server - currently doesn't work

  --nginx-server-root NGINX_SERVER_ROOT
                        Nginx server root directory. (default: /etc/nginx)
  --nginx-ctl NGINX_CTL
                        Path to the 'nginx' binary, used for 'configtest' and
                        retrieving nginx version number. (default: nginx)

webroot:
  Place files in webroot directory

  --webroot-path WEBROOT_PATH, -w WEBROOT_PATH
                        public_html / webroot path. This can be specified
                        multiple times to handle different domains; each
                        domain will have the webroot path that preceded it.
                        For instance: `-w /var/www/example -d example.com -d
                        www.example.com -w /var/www/thing -d thing.net -d
                        m.thing.net` (default: [])
  --webroot-map WEBROOT_MAP
                        JSON dictionary mapping domains to webroot paths; this
                        implies -d for each entry. You may need to escape this
                        from your shell. E.g.: --webroot-map
                        '{"eg1.is,m.eg1.is":"/www/eg1/", "eg2.is":"/www/eg2"}'
                        This option is merged with, but takes precedence over,
                        -w / -d entries. At present, if you put webroot-map in
                        a config file, it needs to be on a single line, like:
                        webroot-map = {"example.com":"/var/www"}. (default:
                        {})

apache:
  Apache Web Server - Alpha

  --apache-enmod APACHE_ENMOD
                        Path to the Apache 'a2enmod' binary. (default:
                        a2enmod)
  --apache-dismod APACHE_DISMOD
                        Path to the Apache 'a2dismod' binary. (default:
                        a2dismod)
  --apache-le-vhost-ext APACHE_LE_VHOST_EXT
                        SSL vhost configuration extension. (default: -le-
                        ssl.conf)
  --apache-server-root APACHE_SERVER_ROOT
                        Apache server root directory. (default: /etc/apache2)
  --apache-vhost-root APACHE_VHOST_ROOT
                        Apache server VirtualHost configuration root (default:
                        /etc/apache2/sites-available)
  --apache-challenge-location APACHE_CHALLENGE_LOCATION
                        Directory path for challenge configuration. (default:
                        /etc/apache2)
  --apache-handle-modules APACHE_HANDLE_MODULES
                        Let installer handle enabling required modules for
                        you.(Only Ubuntu/Debian currently) (default: True)
  --apache-handle-sites APACHE_HANDLE_SITES
                        Let installer handle enabling sites for you.(Only
                        Ubuntu/Debian currently) (default: True)

null:
  Null Installer

Where are my certificates?

All generated keys and issued certificates can be found in /etc/letsencrypt/live/$domain. Rather than copying, please point your (web) server configuration directly to those files (or create symlinks). During the renewal, /etc/letsencrypt/live is updated with the latest necessary files.

Note

/etc/letsencrypt/archive and /etc/letsencrypt/keys contain all previous keys and certificates, while /etc/letsencrypt/live symlinks to the latest versions.

The following files are available:

privkey.pem

Private key for the certificate.

Warning

This must be kept secret at all times! Never share it with anyone, including Certbot developers. You cannot put it into a safe, however – your server still needs to access this file in order for SSL/TLS to work.

This is what Apache needs for SSLCertificateKeyFile, and nginx for ssl_certificate_key.

cert.pem

Server certificate only.

This is what Apache < 2.4.8 needs for SSLCertificateFile.

chain.pem

All certificates that need to be served by the browser excluding server certificate, i.e. root and intermediate certificates only.

This is what Apache < 2.4.8 needs for SSLCertificateChainFile, and what nginx >= 1.3.7 needs for ssl_trusted_certificate.

fullchain.pem

All certificates, including server certificate. This is concatenation of cert.pem andchain.pem.

This is what Apache >= 2.4.8 needs for SSLCertificateFile, and what nginx needs forssl_certificate.

For both chain files, all certificates are ordered from root (primary certificate) towards leaf.

Please note, that you must use either chain.pem or fullchain.pem. In case of webservers, using only cert.pem, will cause nasty errors served through the browsers!

Note

All files are PEM-encoded (as the filename suffix suggests). If you need other format, such as DER or PFX, then you could convert using openssl. You can automate that with--renew-hook if you’re using automatic renewal.

Configuration file

It is possible to specify configuration file with certbot-auto --config cli.ini (or shorter-c cli.ini). An example configuration file is shown below:

# This is an example of the kind of things you can do in a configuration file.
# All flags used by the client can be configured here. Run Certbot with
# "--help" to learn more about the available options.

# Use a 4096 bit RSA key instead of 2048
rsa-key-size = 4096

# Uncomment and update to register with the specified e-mail address
# email = [email protected]

# Uncomment and update to generate certificates for the specified
# domains.
# domains = example.com, www.example.com

# Uncomment to use a text interface instead of ncurses
# text = True

# Uncomment to use the standalone authenticator on port 443
# authenticator = standalone
# standalone-supported-challenges = tls-sni-01

# Uncomment to use the webroot authenticator. Replace webroot-path with the
# path to the public_html / webroot folder being served by your web server.
# authenticator = webroot
# webroot-path = /usr/share/nginx/html

By default, the following locations are searched:

  • /etc/letsencrypt/cli.ini
  • $XDG_CONFIG_HOME/letsencrypt/cli.ini (or ~/.config/letsencrypt/cli.ini if$XDG_CONFIG_HOME is not set).

Getting help

If you’re having problems you can chat with us on IRC (#certbot @ OFTC) or at IRC (#letsencrypt @ freenode) or get support on the Let’s Encrypt forums.

If you find a bug in the software, please do report it in our issue tracker. Remember to give us as much information as possible:

  • copy and paste exact command line used and the output (though mind that the latter might include some personally identifiable information, including your email and domains)
  • copy and paste logs from /var/log/letsencrypt (though mind they also might contain personally identifiable information)
  • copy and paste certbot --version output
  • your operating system, including specific version
  • specify which installation method you’ve chosen

Let’s Encrypt SSL

原文:https://letsencrypt.org/docs/client-options/

 

Let’s Encrypt uses the ACME protocol to verify that you control a given domain name and to issue you a certificate. To get a Let’s Encrypt certificate, you’ll need to choose a piece of ACME client software to use.

Recommended: Certbot

We recommend that most people start with the Certbot client. It can simply get a cert for you or also help you install, depending on what you prefer. It’s easy to use, works on many operating systems, and has great documentation.

If certbot does not meet your needs, or you’d simply like to try something else, there are many more clients to choose from below, grouped by the language or environment they run in.

Bash

Browser

C

Go

HAProxy

nginx

Node.js

Perl

PHP

Python

Ruby

Rust

Windows

Libraries

Go

Java

Node.js

Perl

PHP

Python

Ruby

Rust

Windows

Projects integrating with Let’s Encrypt

 

 

原文:http://www.jianshu.com/p/eaac0d082ba2

HTTPS 那些事

鹅厂Bugly公众号这篇《全站HTTPS来了》写得比较全面了,不再废话。

Let’s Encrypt 介绍

Let’s Encrypt 是一个免费、开放,自动化的证书颁发机构,由 ISRG(Internet Security Research Group)运作。

ISRG 是一个关注网络安全的公益组织,其赞助商从非商业组织到财富100强公司都有,包括 Mozilla、Akamai、Cisco、Facebook,密歇根大学等等。ISRG 以消除资金,技术领域的障碍,全面推进加密连接成为互联网标配为自己的使命。

Let’s Encrypt 项目于2012年由 Mozilla 的两个员工发起,2014年11年对外宣布公开,2015年12月3日开启公测。

Let’s Encrypt 目前处于公测期间,文档,工具还不完善,请谨慎用于生产环境。

Let’s Encrypt 指南

Let’s Encrypt 安装

Let’s Encrypt 目前仅支持 Unix-like 系统,需要 Python 2.6 或 2.7,暂不支持 Python 3。

可以使用 pip 安装 Let’s Encrypt 客户端,或到其 wiki 上查看已打包的各操作系统安装方式。

下面以官方推荐的 letsencrypt-auto 脚本为例进行安装:

$ git clone https://github.com/letsencrypt/letsencrypt

$ cd letsencrypt

$ ./letsencrypt-auto --help

Let’s Encrypt 验证方式

Let’s Encrypt 使用两种方式对申请的域名进行验证:

1、 手动验证 按照提示在申请证书的服务器上使用一个指定的URL提供一个指定的文件内容来进行验证,进行手动验证的服务器IP地址会被 Let’s Encrypt 服务端记录在案。

2、 自动验证 在 目标服务器 (指域名解析对应的IP地址的服务器,下同)上运行客户端,并启动一个 80443 端口进行自动验证。包括独立模式和其他web sever验证模式,在 Plugins 中详细解释

Let’s Encrypt Plugins

Let’s Encrypt 使用不同的 Plugins 来进行证书的获取和安装

Manual

当你在非 目标服务器 上申请证书,或希望进行手动验证时,可以使用 manual 插件,运行命令:

$ ./letsencrypt-auto certonly --manual -d test.example.com

会得到提示:

manual-log-ip

选择 Yes 继续后,便会提示创建一个指定内容的 URL 用来验证对域名及服务器的所有权,注意这个URL仍然需要部署在 目标服务器 上:

Make sure your web server displays the following content at

http://test.example.com/.well-known/acme-challenge/N4mCfskoOSX_7ikZDoEH3iyIqFAUg4Kdg36ecpeUwkw before continuing:

N4mCfskoOSX_7ikZDoEH3iyIqFAUg4Kdg36ecpeUwkw.J7NHjRSPwMW99A2XJv49FTnNu-MSCCebRjccMFZVRic

If you don't have HTTP server configured, you can run the following

command on the target server (as root):

mkdir -p /tmp/letsencrypt/public_html/.well-known/acme-challenge

cd /tmp/letsencrypt/public_html

printf "%s" N4mCfskoOSX_7ikZDoEH3iyIqFAUg4Kdg36ecpeUwkw.J7NHjRSPwMW99A2XJv49FTnNu-MSCCebRjccMFZVRic > .well-known/acme-challenge/N4mCfskoOSX_7ikZDoEH3iyIqFAUg4Kdg36ecpeUwkw

# run only once per server:

$(command -v python2 || command -v python2.7 || command -v python2.6) -c 

"import BaseHTTPServer, SimpleHTTPServer; 

s = BaseHTTPServer.HTTPServer(('', 80), SimpleHTTPServer.SimpleHTTPRequestHandler); 

s.serve_forever()"

Press ENTER to continue

Standalone

使用独立模式进行自动验证,需要在 目标服务器 上运行 Let’s Encrypt 客户端,并指定 certonly--standalone参数。本模式需要绑定 80443 端口进行域名验证,所以如果服务器上已有web server运行并侦听这2个端口,则需要先关闭web server。

Webroot

如果 目标服务器 已有web server运行,并且不能够关闭服务来获取和安装证书,可以使用 Webroot plugin。在运行 Let’s Encrypt 客户端时指定 certonly--webroot 参数,并使用 --webroot-path-w 参数来指定 webroot 目录,比如 --webroot-path /usr/share/nginx/html

Apache

Apache plugin 可以用来为 Apache 2.4 服务器自动获取和安装证书,需要运行在基于 Debian 的操作系统上,并且要求1.0+以上版本的 libaugeas0。如需要运行 Apache plugin,在运行客户端时指定 --apache 参数。本 plugin 仍处在 Alpha 阶段。

Nginx

Nginx plugin 用于为 Nginx 服务器自动获取和安装证书,仍然处在实验阶段,并且 letsencrypt-auto 没有安装这个 plugin,如需使用,运行 pip install letsencrypt-nginx 进行安装后,通过 --nginx 参数调用 plugin。

证书位置

所有版本已申请的证书放在 /etc/letsencrypt/archive下,/etc/letsencrypt/live是指向最新版本的符号链接。web server中关于证书的配置建议指向 live 目录下的文件,以免证书更新后还需要更改配置。

每个域名一个目录,主要包含以下几个文件:

  • cert.pem 申请的服务器证书文件
  • privkey.pem 服务器证书对应的私钥
  • chain.pem 除服务器证书外,浏览器解析所需的其他全部证书,比如根证书和中间证书
  • fullchain.pem 包含服务器证书的全部证书链文件

证书更新

Let’s Encrypt 颁发的服务器证书有效期为90天,官方表示此为出于安全原因,降低错发证书,证书泄漏的危害。通过自动续期来解决有效期短的问题,官方建议每2个月更新证书。

如果到期没有更新证书,CA会向申请证书时提交的邮件地址发送提醒email。

自动续期可以使用 crontab 实现。注意更新证书后重启 web server !

申请频率限制

  • 注册IP限制:每IP每3个小时不超过10次
  • 域名数量限制:每个域名(包含子域名)每7天不超过5个

安装实践

系统环境

  • Ubuntu 14.04.3 LTS x86_64
  • Nginx 1.9.3
  • Python 2.7.6
  • www.saxieyu.com

获取证书

由于 www.saxieyu.com 的 nginx 已在运行中,故使用 webroot 模式来获取证书,使用命令:

$ ./letsencrypt-auto certonly --webroot --webroot-path /usr/share/nginx/html -d www.saxieyu.com --agree-tos --email admin@saxieyu.com

证书申请成功后会提示证书的文件路径,以及证书到期时间:

IMPORTANT NOTES:

- Congratulations! Your certificate and chain have been saved at

/etc/letsencrypt/live/www.saxieyu.com/fullchain.pem. Your cert will

expire on 2016-04-01. To obtain a new version of the certificate in

the future, simply run Let's Encrypt again.

- If you like Let's Encrypt, please consider supporting our work by:

Donating to ISRG / Let's Encrypt:  https://letsencrypt.org/donate

Donating to EFF:                    https://eff.org/donate-le

配置Nginx

生成2048位 DH parameters:

$ sudo openssl dhparam -out /etc/ssl/certs/dhparams.pem 2048

接下来,修改 nginx 配置文件:

server {

    listen 443 ssl;

    server_name www.saxieyu.com;

    ssl_certificate /etc/letsencrypt/live/www.saxieyu.com/fullchain.pem;

    ssl_certificate_key /etc/letsencrypt/live/www.saxieyu.com/privkey.pem;

    ssl_dhparam /etc/ssl/certs/dhparams.pem;

    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';

    ssl_prefer_server_ciphers  on;

    ……

}

配置 http 强制跳转到 https:

server {

    listen 80;

    server_name www.saxieyu.com;

    return 301 https://$server_name$request_uri;

}

验证服务器证书

如上修改过 nginx 配置,并 reload 过 nginx 服务后,使用浏览器访问 https://www.saxieyu.com,验证服务器证书是否正确生效

https

查看服务器证书信息

cert-info

使用 ssllabs 在线测试服务器证书强度及配置正确性

 

文/saxieyu(简书作者)
原文链接:http://www.jianshu.com/p/eaac0d082ba2
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。

天朝颁发的证书一览表

原文:https://plus.google.com/+GhostAssassin/posts/DmZca2RVdTS

 

CFCA Operation CA //中国金融认证中心,<http://www.cfca.com.cn>,由某些网银插件带入
CFCA Operation CA2
CFCA Policy CA
CFCA Root CA

China Trust Network //天威, http://www.itrus.com.cn/

CNNIC ROOT //不解释

iTruschina CN Enterprise Individual Subscriber CA //天威
iTruschina CN Root CA-1
iTruschina CN Root CA-2
iTruschina CN Root CA-3

UCA Root //上海市数字证书认证中心,这个已经通过WebTrust认证, http://www.sheca.com
UCA Global Root

ROOTCA //中国政府的交叉根证书,安装国内CA的相关软件也带进来,自签发证书, http://www.rootca.gov.cn/

WoSign Premium Server Authority // https://www.wosign.cn/
WoSign SGC Server Authority