Creating Certificate Authorities and self-signed SSL certificates



Similar documents
Sun Java System Web Server 6.1 Using Self-Signed OpenSSL Certificate. Brent Wagner, Seeds of Genius October 2007

ViMP 3.0. SSL Configuration in Apache 2.2. Author: ViMP GmbH

SecuritySpy Setting Up SecuritySpy Over SSL

Apache Security with SSL Using Ubuntu

Encrypted Connections

Apache, SSL and Digital Signatures Using FreeBSD

Understanding SSL/TLS

Red Hat Linux Guide to Installing Root Certificates, Generating CSR and Installing SSL Certificate

Application Note AN1502

Low cost secure VPN MikroTik SSTP over OpenIXP (Indonesian Internet) ASTA INFORMATICS Faisal Reza

Security Workshop. Apache + SSL exercises in Ubuntu. 1 Install apache2 and enable SSL 2. 2 Generate a Local Certificate 2

EventTracker Windows syslog User Guide

CentOS. Apache. 1 de 8. Pricing Features Customers Help & Community. Sign Up Login Help & Community. Articles & Tutorials. Questions. Chat.

HOWTO. Configure Nginx for SSL with DoD CAC Authentication on CentOS 6.3. Joshua Penton Geocent, LLC

COMP 3704 Computer Security

Apache Security with SSL Using Linux

Exercises: FreeBSD: Apache and SSL: SANOG VI IP Services Workshop

Ciphermail Gateway Separate Front-end and Back-end Configuration Guide

LAB :: Secure HTTP traffic using Secure Sockets Layer (SSL) Certificate

Using custom certificates with Spectralink 8400 Series Handsets

Enterprise SSL Support

User s guide. APACHE SSL Linux. Using non-qualified certificates with APACHE SSL Linux. version 1.3 UNIZETO TECHNOLOGIES S.A.

e-cert (Server) User Guide For Apache Web Server

Clearswift Information Governance

To enable https for appliance

SWITCHBOARD SECURITY

Unifying Information Security. Implementing TLS on the CLEARSWIFT SECURE Gateway

Setting Up CAS with Ofbiz 5

Configuring SSL VPN with Mac OS X and iphone Clients. Configuration tested. Network Diagram

Oracle Mobile Security Suite Workshop. Installation

Crypto Lab Public-Key Cryptography and PKI

Domino and Internet. Security. IBM Collaboration Solutions. Ask the Experts 12/16/2014

LAB :: Secure HTTP traffic using Secure Sockets Layer (SSL) Certificate

Generating and Installing SSL Certificates on the Cisco ISA500

Installing an SSL certificate on the InfoVaultz Cloud Appliance

Securing Your Apache Web Server With a Thawte Digital Certificate

Linux Deployment Guide. How to deploy Network Shutdown Module for Linux

LoadMaster SSL Certificate Quickstart Guide

CERTIFICATE-BASED SINGLE SIGN-ON FOR EMC MY DOCUMENTUM FOR MICROSOFT OUTLOOK USING CA SITEMINDER

Using Client Side SSL Certificate Authentication on the WebMux

Configuring Ubuntu Server as a Firewall and Reverse Proxy for OWA 2007 Configuration Guide

>copy openssl.cfg openssl.conf (use the example configuration to create a new configuration)

AN054 SERIAL TO WI-FI (S2W) HTTPS (SSL) AND EAP SECURITY

KMIP installation Guide. DataSecure and KeySecure Version SafeNet, Inc

Protect your CollabNet TeamForge site

X.509 and SSL. A look into the complex world of X.509 and SSL UUASC 07/05/07. Phil Dibowitz

Scenarios for Setting Up SSL Certificates for View

10gAS SSL / Certificate Based Authentication Configuration

Secure Traffic Inspection

Installing Dspace 1.8 on Ubuntu 12.04


Enable SSL in Go2Group SOAP Server

Virtual Private Network (VPN) Lab

Technical specification

unigui Developer's Manual 2014 FMSoft Co. Ltd.

Cloud Services. Introduction...2 Overview...2. Security considerations Installation...3 Server Configuration...4

MassTransit 6.0 Enterprise Web Configuration for Macintosh OS 10.5 Server

Installing an SSL Certificate Provided by a Certificate Authority (CA) on the vwlan Appliance

Laboratory Exercises VI: SSL/TLS - Configuring Apache Server

SSL Certificates in IPBrick

Websense Content Gateway HTTPS Configuration

Configuring TLS Security for Cloudera Manager

Install an SSL Certificate onto SilverStream. Sender Recipient Attached FIles Pages Date. Development Internal/External None 5 6/16/08

Go to Policy/Global Properties/SmartDashboard Customization, click Configure. In Certificates and PKI properties, change host_certs_key_size to 2048

WebLogic Server 6.1: How to configure SSL for PeopleSoft Application

Yealink Technical White Paper. Contents. About VPN Types of VPN Access VPN Technology... 3 Example Use of a VPN Tunnel...

Network-Enabled Devices, AOS v.5.x.x. Content and Purpose of This Guide...1 User Management...2 Types of user accounts2

FUJITSU Cloud IaaS Trusted Public S5 Configuring a Server Load Balancer

SSL Interception on Proxy SG

DoD Public Key Enablement (PKE) Quick Reference Guide. Securing Apache HTTP with mod_ssl for Linux

Obtaining SSL Certificates for VMware Horizon View Servers

Acano solution. Acano Solution Installation Guide. Acano. January B

RED HAT SECURE WEB SERVER 3.0 DEVELOPER EDITION FOR COBALT NETWORKS SERVERS

Setting Up Your FTP Server

Apache based WebDAV Server with LDAP and SSL

How to generate SSL certificates for use with a KVM box & XViewer with XCA v0.9.3

Customizing SSL in CA WCC r11.3 This document contains guidelines for customizing SSL access to CA Workload Control Center (CA WCC) r11.3.

Generating SSH Keys and SSL Certificates for ROS and ROX Using Windows AN22

Alliance Key Manager A Solution Brief for Technical Implementers

Cisco TelePresence VCS Certificate Creation and Use

Acano solution. Certificate Guidelines R1.7. for Single Combined Acano Server Deployments. December H

Acano solution. Virtualized Deployment R1.1 Installation Guide. Acano. February B

NetApp Storage Encryption: Preinstallation Requirements and Procedures for SafeNet KeySecure

esync - Receiving data over HTTPS

Cisco Expressway Certificate Creation and Use

Chapter 7 Managing Users, Authentication, and Certificates

Self Signed Certificates

Setting Up SSL on IIS6 for MEGA Advisor

Virtual Private Network with OpenVPN

Installing an SSL Certificate Provided by a Certificate Authority (CA) on the BlueSecure Controller (BSC)

Securing Web Access with a Private Certificate Authority

CHAPTER 7 SSL CONFIGURATION AND TESTING

Basic Configuration. Key Operator Tools older products. Program/Change LDAP Server (page 3 of keyop tools) Use LDAP Server must be ON to work

Secure Transfers. Contents. SSL-Based Services: HTTPS and FTPS 2. Generating A Certificate 2. Creating A Self-Signed Certificate 3

SSL Configuration on Weblogic Oracle FLEXCUBE Universal Banking Release [August] [2014]

Certificate technology on Pulse Secure Access

This section describes how to use SSL Certificates with SOA Gateway running on Linux.

Using EMC Unisphere in a Web Browsing Environment: Browser and Security Settings to Improve the Experience

Certificate technology on Junos Pulse Secure Access

Transcription:

Creating Certificate Authorities and self-signed SSL certificates http://www.tc.umn.edu/-brams006/selfsign.html Creating Certificate Authorities and self-signed SSL certificates Following is a step-by-step guide to creating your own CA (Certificate Authority) -- and also self-signed SSL server certificates -- with openssl on Linux. Self-signing is the simpler route to take, but making one's own CA allows the signing of multiple server certificates using the same CA and involves only a few extra steps. After using openssl to generate the necessary files, you'll need to integrate them into Apache. This process differs between Linux distros and versions of Apache. Additional references exist at the end of this document. My instructions for Setting up SSL: Debian and Apache 2 are kept most current, and will carry you through to completion. Making a homemade CA or self-signed certificate will cause the client web browser to prompt with a message whether to trust the certificate signing authority (yourself) permanently (store it in the browser), temporarily for that session, or to reject it. The message "web site certified by an unknown authority... accept?" may be a business liability for general public usage, although it's simple enough for the client to accept the certificate permanently. Whichever route you take, you'll save the periodic expense of paying a recognized signing authority. This is purely for name recognition -- they've paid the major browser producers to have their CA pre-loaded into them. So if you're on a budget, have a special need or small audience, this may be useful. Before you start You need Apache and openssl. Compiling them from source, handling dependencies, etc. is beyond the scope of this document. You can consult their documentation, or go with a mainstream Linux distro that will do the preliminary work for you. Now you need to decide whether you'll make a CA (Certificate Authority) and sign a server certificate with it -- or just self-sign a server certificate. Both procedures are detailed below. (1A) Create a self-signed certificate. Complete this section if you do NOT want to make a CA (Certificate Authority). CA, skip 1A entirely and go to 1B instead. If you want to make a Some steps in this document require priviledged access, and you'll want to limit access to the cert files to all but the root user. So you should su to root and create a working directory that only root has read/write access to (for example: mkdir certwork, chmod 600 certwork). Go to that directory. Generate a server key: -! openssl genrsa -des3 -out server.key 4096 ~--~~--- -~------"-- ---- Then create a certificate signing request with it. This command will prompt for a series of things (country, state or province, etc.). Make sure that "Common Name (eg, YOUR name)" matches the registered fully qualified domain name of your box (or your IP address if you don't have one). I also lof5

Creating Certificate Authorities and self-signed SSL certificates http://www.tc.umn.edul-brams006/selfsign.html suggest not making a challenge password at this point, since it'll just mean more typing for you. The default values for the questions ([AU], Internet Widgits Pty Ltd, etc.) are stored here: /etc/ssl /openssl.cnf. So if you've got a large number of certificate signing requests to process you probably want to carefully edit that file where appropriate. Otherwise, just execute the command below and type what needs to be typed: openssl req -new -key server.key -out server.csr Now sign the certificate signing request. This example lasts 365 days: openssl x509 -req -days 365 -In server.csr -signkey server.key -out server.crt Make a version of the server.key which doesn't need a password:,----------- ----------- openssl rsa -in server.key -out server.key.insecure mv server.key server.key.secure mv server.key.insecure server.key These files are quite sensitive and should be guarded for permissions very carefully. Chown them to root, if you're not already sudo'd to root. I've found that you can chmod 000 them. That is, root will always retain effective 600 (read) rights on everything. Now that you've just completed Step 1A, skip ahead to Step 2. B) Generate your own CA (Certificate Authority). Complete this section if you want to make a CA (Certificate Authority) and sign a server certificate with it. The steps for making a server certificate are also included here. If you'd rather one-time self-sign a server certificate, skip this step entirely and go to 1A instead. Some steps in this document require priviledged access, and you'll want to limit access to the cert files to all but the root user. So you should su to root and create a working directory that only root has read/write access to (for example: mkdir certwork, chmod 600 certwork). Go to that directory. In this step you'll take the place of VeriSign, Thawte, etc. You'll first build the CA key, then build the certificate itself. The Common Name (CN) of the CA and the Server certificates must NOT match or else a naming collision will occur and you'll get errors later on. In this step, you'll provide the CA entries. In a step below, you'll provide the Server entries. In this example, I just added "CA" to the CA's CN field, to distinguish it from the Server's CN field. Use whatever schema you want, just make sure the CA and Server entries are not identical. CA: Common Name (CN): www.somesite.edu Organization (0): Somesite Organizational Unit (OU): Development CA Server: Common Name (CN): www.somesite.edu Organization (0): Somesite 20f5

Creating Certificate Authorities and self-signed SSL certificates http://www.tc.mnn.edul~brams006/selfsign.htrnl Organizational Unit (OU): Development If you don't have a fully qualified domain name, you should use the IP that you'll be using to access your SSL site for Common Name (CN). But, again, make sure that something differentiates the entry of the CA's CN from the Server's CN. Iopenssl genrsa -des3 -out ca.key 4096 openssl req -new -x509 -days 365 -key ca. key -out ca.crt Generate a server key and request for signing (csr). This step creates a server key, and a request that you want it signed (the.csr file) by a Certificate Authority (the one you just created in Step #1 B above.) Think carefully when inputting a Common Name (CN) as you generate the.csr file below. This should match the DNS name, or the IP address you specify in your Apache configuration. If they don't match, client browsers will get a "domain mismatch" message when going to your https web server. If you're doing this for home use, and you don't have a static IP or DNS name, you might not even want worry about the message (but you sure will need to worry if this is a production/public server). For example, you could match it to an internal and static IP you use behind your router, so that you'll never get the "domain mismatch" message if you're accessing the computer on your home LAN, but will always get that message when accessing it elsewhere. Your call -- is your IP stable, do you want to repeat these steps every time your IP changes, do you have a DNS name, do you mainly use it inside your home or LAN, or outside? openssl genrsa -des3 -out server.key 4096 openssl req -new -key server.key -out server.csr Sign the certificate signing request (csr) with the self-created Certificate Authority (CA) that you made earlier. Note that 365 days is used here. After a year you'll need to do this again. Note also that I set the serial number of the signed server certificate to "01". Each time you do this, especially if you do this before a previously-signed certificate expires, you'll need to change the serial key to something else -- otherwise everyone who's visited your site with a cached version of your certificate will get a browser warning message to the effect that your certificate signing authority has screwed up -- they've signed a new key/request, but kept the old serial number. There are a couple ways to rectify that. crl's (certificate revocation list) is one method, but beyond the scope of the document. Another method is for all clients which have stored the CA certificate to go into their settings and delete the old one manually. But for the purposes of this document, we'll just avoid the problem. (If you're a sysadmin of a production system and your server. key is compromised, you'll certainly need to worry.) The command below does a number of things. It takes your signing request (csr) and makes a one-year valid signed server certificate (crt) out of it. In doing so, we need to tell it which Certificate Authority (CA) to use, which CA key to use, and which Server key to sign. We set the serial number to 01, and output the signed key in the file named server. crt. If you do this again after people have visited your site and trusted your CA (storing it in their browser), you might want to use 02 for the next serial number, and so on. You might create some scheme to make the serial number more "official" in appearance or makeup but keep in mind that it is fully exposed to the public in their web browsers, so it offers no additional security in itself. 30f5

Creating Certificate Authorities and self-signed SSL certificates http://www.tc. umn.edul-brams006/selfsign.html openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out server.crt To examine the components if you're curious: openssl rsa -noout -text -ln server.key openssl req -noout -text -in server.csr openssl rsa -noout -text -in ca.key ~penssl x509 -noout -text -ln ca.crt : M::jIKF! a server.key which doesn't cause Apache to prompt for a password. Here we create an insecure version of the server. key. The insecure one will be used for when Apache starts, and will not require a password with every restart of the web server. But keep in mind that while this means you don't have to type in a password when restarting Apache (or worse -- coding it somewhere in plaintext), it does mean that anyone obtaining this insecure key will be able to decrypt your transmissions. Guard it for permissions VERY carefully. openssl rsa -ln server.key -out server.key.insecure mv server.key server.key.secure mv server.key.insecure server.key These files are quite sensitive and should be guarded for permissions very carefully. Chown them to root, if you're not already sudo'd to root. I've found that you can chmod 000 them. That is, root will always retain effective 600 (read) rights on everything. (2) Copy files into position and tweak Apache. Some professors like to pause for a moment after a long lecture, and do a little recap. It's a good pedagogical tool, so let's do so here. If you took route 1A above, you should have four files in a working directory: server. crt: The self-signed server certificate. server.csr: Server certificate signing request. server. key: The private server key, does not require a password when starting Apache. server. key.secure: The private server key, it does require a password when starting Apache. If you took route 1B and created a CA, you'll have two additional files: ca. crt: The Certificate Authority's own certificate. ca. key: The key which the CA uses to sign server signing requests. The CA files are important to keep if you want to sign additional server certificates and preserve the same CA. You can reuse these so long as they remain secure, and haven't expired. At a bare minimum, the following considerations must now be addressed: You'll need a virtual host and document root set up for the SSL instance. You'll need to turn on the SSL engine and enable/load the SSL module. Apache must reference server.crt and server. key somewhere in its configuration. Apache must be listening to a port for which SSL is enabled (443 is default). 40f5

Creating Certificate Authorities and self-signed SSL certificates http://www.tc.umn.edu!~brams006/selfsign.html The particulars differ between Linux distros and versions of Apache. I'm only able to keep the Setting up SSL: Debian and Apache 2 documentation current due to time constraints. Those steps should apply broadly to other Debian-based distros with little or no modification. Red Hat and opensuse commentary is kept online here for historical purposes. Setting up SSL: Debian and Apache 2 Setting up SSL: Ubuntu and Apache 2 Setting up SSL: Red Hat and Apache 1.3.x Setting up SSL: opensuse Paul Bramscher E-mail: brams006@umn.edu Updated: June 15,2012 The views and opinions expressed in this page are strictlythorofthe page author. The contents of this page have not been reviewed or approved by the Universityof Minnesota. 50f5