• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
OpenTechTips

OpenTechTips

Comprehensive IT Guides for Pros and Enthusiasts

MENUMENU
  • HOME
  • ALL TOPICS
    • Exchange
    • InfoSec
    • Linux
    • Networking
    • Scripting
      • PowerShell
    • SSL
    • Tools
    • Virtualization
    • Web
    • Windows
  • ABOUT
  • SUBSCRIBE
Home » Install Let’s Encrypt SSL for IIS – Step by Step

Install Let’s Encrypt SSL for IIS – Step by Step

March 31, 2020 - by Zsolt Agoston - last edited on May 20, 2020

If you desperately need an SSL certificate signed by a publicly trusted CA, and you want it for free, Let’s Encrypt is certainly an option. They are valid for 3 months, and even though linux boxes are equipped to request and auto-renew them, we can certainly deploy them in our IIS service, let’s see how.

We have our server hosting our presentation webpage, we want it to be publicly available and use HTTPS on it.

Inventory, Requirements:

  • Local IIS server: WEBSERVER.jd0e.com
  • Public address: https://presentation.jd0e.com

Creating the SSL – linux to the rescue

First, we need to have certbot, the official app Let’s Encrypt has to generate our certificate, the private key, and CA signed public key. We use a Debian VM for that, which has 80/tcp publicly accessible from the public IP assigned to presentation.opentechtips.com publicly, that is for certbot to veify our domain ownership. Once it is done, we redirect public traffic from the linux box to the actual IIS box.

We install the certbot package on our fresh Debian box

# Install the Let’s Encrypt agent
 apt install certbot
  
# Generate the certificate
 certbot certonly --standalone --preferred-challenges http -d presentation.jd0e.com

After the verification process, where the agent temporarily spins up a simple http server, exposing a verification file temporarily online. This is to automatically check that this server is reached publicly when browsing to the domain specified in the cert request. We get the location of the cert files – which is /etc/letsencrypt/live/presentation.jd0e.com, and the validity period confirmed.

Install Let’s Encrypt SSL for IIS – Step by Step

 Packing the SSL keys in a single PFX file for Windows

We simply navigate in the directory that contains the private key, public key and the chain information file, and generate our .PFX file that can be imported in the Windows box.

 cd /etc/letsencrypt/live/presentation.jd0e.com
  
# Packing the SSL into a PKCS12-type file
 openssl pkcs12 -export -out /tmp/presentation_jd0e_com.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem
Install Let’s Encrypt SSL for IIS – Step by Step

Now we only need to copy the file to the windows machine. I usually use ssh, copying the file over from the /tmp directory on the linux box to the c:\temp folder on the windows server.

Install Let’s Encrypt SSL for IIS – Step by Step

Importing the SSL and setting up IIS

Now the only thing is left is importing the certificate and setting up IIS. To import the pfx file we double-click on it, select the local computer as the target store. Mark the private key as exportable for possible future distribution of the cert, then import it to the personal  container.

Install Let’s Encrypt SSL for IIS – Step by Step

Checking the store shows the certificate, the small key-symbol in the corner of the certificate-icon shows that we have a valid private key also imported so it will show up in IIS without a problem.

Install Let’s Encrypt SSL for IIS – Step by Step

We create the new “presentation” site in IIS and bind the cert to port 443/tcp (HTTPS), see below.

Install Let’s Encrypt SSL for IIS – Step by Step

Now we only need to verify if the site is accessible and encrypted 🙂

Install Let’s Encrypt SSL for IIS – Step by Step

Reader Interactions

Comments Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Tools

Secondary Sidebar

CONTENTS

  • Creating the SSL – linux to the rescue
  •  Packing the SSL keys in a single PFX file for Windows
  • Importing the SSL and setting up IIS

  • Terms of Use
  • Disclaimer
  • Privacy Policy
Manage your privacy

To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.

Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.

Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}
Manage your privacy
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Statistics

Marketing

Features
Always active

Always active
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Manage options
{title} {title} {title}