<commit_before>Description
===========
[![Cookbook Version](https://img.shields.io/cookbook/v/ssl_certificate.svg?style=flat)](https://supermarket.chef.io/cookbooks/ssl_certificate)
[![GitHub Source](https://img.shields.io/badge/source-GitHub-blue.svg?style=flat)](https://github.com/zuazo/ssl_certificate-cookbook)
[![Dependency Status](http://img.shields.io/gemnasium/zuazo/ssl_certificate-cookbook.svg?style=flat)](https://gemnasium.com/zuazo/ssl_certificate-cookbook)
[![Code Climate](http://img.shields.io/codeclimate/github/zuazo/ssl_certificate-cookbook.svg?style=flat)](https://codeclimate.com/github/zuazo/ssl_certificate-cookbook)
[![Build Status](http://img.shields.io/travis/zuazo/ssl_certificate-cookbook.svg?style=flat)](https://travis-ci.org/zuazo/ssl_certificate-cookbook)

The main purpose of this cookbook is to make it easy for other cookbooks to support SSL. With the resource included, you will be able to manage certificates reading them from attributes, data bags or chef-vaults. Exposing its configuration through node attributes.

Much of the code in this cookbook is heavily based on the SSL implementation from the [owncloud](https://supermarket.chef.io/cookbooks/owncloud) cookbook.

Table of Contents
=================

* [Requirements](#requirements)
  * [Supported Platforms](#supported-platforms)
  * [Required Applications](#required-applications)
* [Attributes](#attributes)
  * [Service Attributes](#service-attributes)
* [Resources](#resources)
  * [ssl_certificate](#ssl_certificate)
    * [ssl_certificate Actions](#ssl_certificate-actions)
    * [ssl_certificate Parameters](#ssl_certificate-parameters)
* [Templates](#templates)
  * [Partial Templates](#partial-templates)
  * [Securing Server Side TLS](#securing-server-side-tls)
* [Usage](#usage)
  * [Including the Cookbook](#including-the-cookbook)
  * [A Short Example](#a-short-example)
  * [Namespaces](#namespaces)
  * [Examples](#examples)
    * [Apache Examples](#apache-examples)
    * [Nginx Example](#nginx-example)
    * [Reading the Certificate from Attributes](#reading-the-certificate-from-attributes)
    * [Reading the Certificate from a Data Bag](#reading-the-certificate-from-a-data-bag)
    * [Reading the Certificate from Chef Vault](#reading-the-certificate-from-chef-vault)
    * [Reading the Certificate from Files](#reading-the-certificate-from-files)
    * [Reading the Certificate from Different Places](#reading-the-certificate-from-different-places)
    * [Creating a Certificate with Subject Alternate Names](#creating-a-certificate-with-subject-alternate-names)
    * [Reading Key, Certificate and Intermediary from a Data Bag](#reading-key-certificate-and-intermediary-from-a-data-bag)
    * [Creating a Certificate from a Certificate Authority](#creating-a-certificate-from-a-certificate-authority)
    * [Reading the CA Certificate from a Chef Vault Bag](#reading-the-ca-certificate-from-a-chef-vault-bag)
    * [Managing Certificates Via Attributes](#managing-certificates-via-attributes)
* [Testing](#testing)
  * [ChefSpec Matchers](#chefspec-matchers)
    * [ssl_certificate(name)](#ssl_certificatename)
    * [create_ssl_certificate(name)](#create_ssl_certificatename)
* [Contributing](#contributing)
* [TODO](#todo)
* [License and Author](#license-and-author)

Requirements
============

## Supported Platforms

This cookbook has been tested on the following platforms:

* Amazon Linux
* CentOS
* Debian
* Fedora
* FreeBSD
* Oracle Linux
* RedHat
* Scientific Linux
* Ubuntu
* Windows

Please, [let us know](https://github.com/zuazo/ssl_certificate-cookbook/issues/new?title=I%20have%20used%20it%20successfully%20on%20...) if you use it successfully on any other platform.

## Required Applications

* Chef `>= 11.14.2`.
* Ruby `1.9.3` or higher.

Attributes
==========

| Attribute                                             | Default      | Description                        |
|:------------------------------------------------------|:-------------|:-----------------------------------|
| `node['ssl_certificate']['user']`                     | `'root'`     | Default SSL files owner user.<commit_msg>README: Update user attribute default value<commit_after>Description
===========
[![Cookbook Version](https://img.shields.io/cookbook/v/ssl_certificate.svg?style=flat)](https://supermarket.chef.io/cookbooks/ssl_certificate)
[![GitHub Source](https://img.shields.io/badge/source-GitHub-blue.svg?style=flat)](https://github.com/zuazo/ssl_certificate-cookbook)
[![Dependency Status](http://img.shields.io/gemnasium/zuazo/ssl_certificate-cookbook.svg?style=flat)](https://gemnasium.com/zuazo/ssl_certificate-cookbook)
[![Code Climate](http://img.shields.io/codeclimate/github/zuazo/ssl_certificate-cookbook.svg?style=flat)](https://codeclimate.com/github/zuazo/ssl_certificate-cookbook)
[![Build Status](http://img.shields.io/travis/zuazo/ssl_certificate-cookbook.svg?style=flat)](https://travis-ci.org/zuazo/ssl_certificate-cookbook)

The main purpose of this cookbook is to make it easy for other cookbooks to support SSL. With the resource included, you will be able to manage certificates reading them from attributes, data bags or chef-vaults. Exposing its configuration through node attributes.

Much of the code in this cookbook is heavily based on the SSL implementation from the [owncloud](https://supermarket.chef.io/cookbooks/owncloud) cookbook.

Table of Contents
=================

* [Requirements](#requirements)
  * [Supported Platforms](#supported-platforms)
  * [Required Applications](#required-applications)
* [Attributes](#attributes)
  * [Service Attributes](#service-attributes)
* [Resources](#resources)
  * [ssl_certificate](#ssl_certificate)
    * [ssl_certificate Actions](#ssl_certificate-actions)
    * [ssl_certificate Parameters](#ssl_certificate-parameters)
* [Templates](#templates)
  * [Partial Templates](#partial-templates)
  * [Securing Server Side TLS](#securing-server-side-tls)
* [Usage](#usage)
  * [Including the Cookbook](#including-the-cookbook)
  * [A Short Example](#a-short-example)
  * [Namespaces](#namespaces)
  * [Examples](#examples)
    * [Apache Examples](#apache-examples)
    * [Nginx Example](#nginx-example)
    * [Reading the Certificate from Attributes](#reading-the-certificate-from-attributes)
    * [Reading the Certificate from a Data Bag](#reading-the-certificate-from-a-data-bag)
    * [Reading the Certificate from Chef Vault](#reading-the-certificate-from-chef-vault)
    * [Reading the Certificate from Files](#reading-the-certificate-from-files)
    * [Reading the Certificate from Different Places](#reading-the-certificate-from-different-places)
    * [Creating a Certificate with Subject Alternate Names](#creating-a-certificate-with-subject-alternate-names)
    * [Reading Key, Certificate and Intermediary from a Data Bag](#reading-key-certificate-and-intermediary-from-a-data-bag)
    * [Creating a Certificate from a Certificate Authority](#creating-a-certificate-from-a-certificate-authority)
    * [Reading the CA Certificate from a Chef Vault Bag](#reading-the-ca-certificate-from-a-chef-vault-bag)
    * [Managing Certificates Via Attributes](#managing-certificates-via-attributes)
* [Testing](#testing)
  * [ChefSpec Matchers](#chefspec-matchers)
    * [ssl_certificate(name)](#ssl_certificatename)
    * [create_ssl_certificate(name)](#create_ssl_certificatename)
* [Contributing](#contributing)
* [TODO](#todo)
* [License and Author](#license-and-author)

Requirements
============

## Supported Platforms

This cookbook has been tested on the following platforms:

* Amazon Linux
* CentOS
* Debian
* Fedora
* FreeBSD
* Oracle Linux
* RedHat
* Scientific Linux
* Ubuntu
* Windows

Please, [let us know](https://github.com/zuazo/ssl_certificate-cookbook/issues/new?title=I%20have%20used%20it%20successfully%20on%20...) if you use it successfully on any other platform.

## Required Applications

* Chef `>= 11.14.2`.
* Ruby `1.9.3` or higher.

Attributes
==========

| Attribute                                             | Default      | Description                        |
|:------------------------------------------------------|:-------------|:-----------------------------------|
| `node['ssl_certificate']['user']`                     | *calculated* | Default SSL files owner user.
{'fraction_non_alphanumeric': 0.16678709055876687, 'fraction_numerical': 0.004816955684007707, 'mean_word_length': 4.323717948717949, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2288718', 'n_tokens_mistral': 2650, 'n_tokens_neox': 2404, 'n_words': 484}