OpenSSL Cookbook
Table of Contents
Preface
Feedback
About Bulletproof SSL and TLS
About the Author
Chapter 1: OpenSSL
Getting Started
Determine OpenSSL Version and Configuration
Building OpenSSL
Examine Available Commands
Building a Trust Store
Conversion Using Perl
Conversion Using Go
Key and Certificate Management
Key Generation
Creating Certificate Signing Requests
Creating CSRs from Existing Certificates
Unattended CSR Generation
Signing Your Own Certificates
Creating Certificates Valid for Multiple Hostnames
Examining Certificates
Key and Certificate Conversion
PEM and DER Conversion
PKCS#12 (PFX) Conversion
PKCS#7 Conversion
Configuration
Cipher Suite Selection
Obtaining the List of Supported Suites
Keywords
Combining Keywords
Building Cipher Suite Lists
Keyword Modifiers
Sorting
Handling Errors
Putting It All Together
Recommended Configuration
Performance
Creating a Private Certification Authority
Features and Limitations
Creating a Root CA
Root CA Configuration
Root CA Directory Structure
Root CA Generation
Structure of the Database File
Root CA Operations
Create a Certificate for OCSP Signing
Creating a Subordinate CA
Subordinate CA Configuration
Subordinate CA Generation
Subordinate CA Operations
Chapter 2: Testing with OpenSSL
Connecting to SSL Services
Testing Protocols that Upgrade to SSL
Using Different Handshake Formats
Extracting Remote Certificates
Testing Protocol Support
Testing Cipher Suite Support
Testing Servers that Require SNI
Testing Session Reuse
Checking OCSP Revocation
Testing OCSP Stapling
Checking CRL Revocation
Testing Renegotiation
Testing for the BEAST Vulnerability
Testing for Heartbleed
Determining the Strength of Diffie-Hellman Parameters
Appendix A: SSL/TLS Deployment Best Practices
1 Private Key and Certificate
1.1 Use 2048-Bit Private Keys
1.2 Protect Private Keys
1.3 Ensure Sufficient Hostname Coverage
1.4 Obtain Certificates from a Reliable CA
1.5 Use Strong Certificate Signature Algorithms
2 Configuration
2.1 Use Complete Certificate Chains
2.2 Use Secure Protocols
2.3 Use Secure Cipher Suites
2.4 Select Best Cipher Suites
2.5 Use Forward Secrecy
2.6 Use Strong Key Exchange
2.7 Mitigate Known Problems
3 Performance
3.1 Avoid Too Much Security
3.2 Use Session Resumption
3.3 Use WAN Optimization and HTTP/2
3.4 Cache Public Content
3.5 Use OCSP Stapling
3.6 Use Fast Cryptographic Primitives
4 HTTP and Application Security
4.1 Encrypt Everything
4.2 Eliminate Mixed Content
4.3 Understand and Acknowledge Third-Party Trust
4.4 Secure Cookies
4.5 Secure HTTP Compression
4.6 Deploy HTTP Strict Transport Security
4.7 Deploy Content Security Policy
4.8 Do Not Cache Sensitive Content
4.9 Consider Other Threats
5 Validation
6 Advanced Topics
7 Changes
Version 1.3 (17 September 2013)
Version 1.4 (8 December 2014)
Version 1.5 (8 June 2016)
Acknowledgments
About SSL Labs
About Qualys
Appendix B: Changes
v1.0 (May 2013)
v1.1 (October 2013)
v2.0 (March 2015)
v2.1 (March 2016)