GithubHelp home page GithubHelp logo

iis-certsync's Introduction

IIS CertSync

A script to update multiple IIS sites' HTTPS certificate based on a source site

If you are using Let's Encrypt to renew your certificates on IIS and at the same time use Application Request Routing to provide load balancing or to facilitate a blue/green deploy, chances are your blue/green sites are not having their certificates renewed properly when the umbrella site has.

This leads to all HTTPS requests failing with 502, but can be fixed simply by assigning the appropriate certificate to the blue/green sites.

This script provides a simple workaround - whenever Let's Encrypt finishes its automatic renewal task, the script makes sure the certificates are in sync.

Usage

  1. Install scriptcs

  2. Download the update-https-bindings.csx script and scriptcs_packages.config

  3. Install NuGet packages required by the script. Run the following command in the directory where the script is located:

     scriptcs -install
    
  4. Try running the script (see explanation of the command line parameters below):

     scriptcs c:\SSL\scripts\update-https-bindings.csx -- c:\SSL\scripts\log.txt MySite "*:443:www.mysite.com" "MySiteBlue|*:44301:www.mysite.com,MySiteGreen|*:44302:www.mysite.com"
    

The script is being called as follows:

scriptcs <script-path> -- <log-path> <source-site> <source-site-binding> <list-of-targets>

Where

  • <source-site> is the name of the site you want to copy the certificate settings from. This will be the site whose certificate Let's Encrypt is renewing properly.
  • <source-site-binding> specifies which source site binding we should use to get the certificate. The pattern is <ip>:<port>:<hostname> with * being used for non-specified values
  • <list-of-targets> is a comma-separated list of pairs of the form <site-name>|<binding> with both components having the same form as the source site equivalent described above

After you tune your command line, I suggest adding the command as an additional action of the Let's Encrypt scheduled task.

iis-certsync's People

Contributors

skurik 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.