Giter Site home page Giter Site logo

acme-rs's Introduction

Usage

  1. The default CA (Certificate Authority) is Let's Encrypt, and the default algorithm is EC3, which is secp384r1.
git clone https://github.com/penghcn/acme-rs.git
cd acme-rs/

cargo run --  dns=ai8.rs,www.ai8.rs dir=/www/ai8.rs
  1. To use another CA like ZeroSSL, like this:
cargo run --  dns=ai8.rs,www.ai8.rs dir=/www/ai8.rs ca=z [email protected] alg=ec5
  1. For more parameter configurations, please refer to the following.
key default description
dns - Required, single or multiple, separated by commas. For example: ai8.rs,www.ai8.rs
dir - Required, acme root path, must match your nginx config, e.g. /www/ai8.rs
email - Register account email. When ca is ZeroSSL, email required
ca le Case-insensitive. The defalut is "le", which stands for Let's Encrypt. ZeroSSL can be abbreviated as "Z","z","zero". Google Trust as "g". BuyPass as "b"
alg ec3 Case-insensitive. Algorithm abbreviation: ec2,ec3,ec5,rsa2,rsa4, which are secp256r1,secp384r1,secp521r1,rsa2048,rsa4096
log info Case-insensitive. Log level: info,debug,trace
  1. Nginx configuration.
    ## for acme ssl
    server {
        listen 80;
        server_name ai8.rs www.ai8.rs;
        location /.well-known/acme-challenge/ {
            alias /www/ai8.rs/challenges/;
            try_files $uri =404;
        }

        location / {
            rewrite ^/(.*)$ https://$http_host/$1 permanent;
        }       
    }

    server {
        listen 443 ssl http2;
        server_name ai8.rs www.ai8.rs;

        include ssl.conf; # Recommended SSL ciphers 

        ssl_certificate /www/ai8.rs/.acme/chained.pem;
        ssl_certificate_key /www/ai8.rs/.acme/domain.key;

        real_ip_header X-Real-IP;
        
        location / {
            proxy_set_header    X-Real-IP       $remote_addr;
            proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
            #proxy_set_header   Host            $http_host;
            proxy_set_header    X-NginX-Proxy   true;
            proxy_set_header    Connection      "";
            proxy_http_version  1.1;
            proxy_pass          https://bing.com;
        }
    }

Parameter must match the nginx configuration. For example:

    ## dns=ai8.rs,www.ai8.rs
    server_name ai8.rs www.ai8.rs;

    ## The "/challenges/" directory is a fixed path
    ## dir=/www/ai8.rs
    alias /www/ai8.rs/challenges/;

    ## The files "/.acme/chained.pem" and "/.acme/domain.key" are at fixed paths
    ## dir=/www/ai8.rs
    ssl_certificate /www/ai8.rs/.acme/chained.pem;
    ssl_certificate_key /www/ai8.rs/.acme/domain.key;

Recommended SSL ciphers. Typically located at "ssl.conf" file.

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;
    ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4;
  1. Install rust. Official link.
curl --proto '=https' --tlsv1.3 -sSf https://sh.rustup.rs | sh

Fix some errors.

# For Debian, Ubuntu 
# error: linker `cc` not found
# error: could not compile `proc-macro2` (build script) due to 1 previous error rust
sudo apt update
sudo apt install curl build-essential gcc make -y

# failed to run custom build command for `openssl-sys v0.9.102`
sudo apt install libssl-dev pkg-config -y

acme-rs's People

Contributors

penghcn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.