1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-09-11 21:30:45 +03:00

Document how to use OpenSSL for Windows and Linux

This commit is contained in:
bel
2013-12-14 22:28:57 +01:00
parent 8b2f8450eb
commit bafcfe517b

80
docs/OpenSSL.md Normal file
View File

@@ -0,0 +1,80 @@
Adding OpenSSL Support
=====
Civetweb supports *HTTPS* connections using the OpenSSL transport layer
security (TLS) library. OpenSSL is a free, open source library (see
http://www.openssl.org/).
Getting Started
----
- Install OpenSSL on your system. There are OpenSSL install packages for all
major Linux distributions as well as a setup for Windows.
- The default build configuration of the civetweb web server will load the
required OpenSSL libraries, if a HTTPS certificate has been configured.
Civetweb Configuration
----
The configuration file should contain an https port, e.g.
listening_ports 80, 443s
to server http and https from their standard ports, or
listening_ports 443s
to serve only https.
Furthermore the SSL certificate file must be set, e.g.
ssl_certificate d:\civetweb\certificate\server.pem
Creating a self signed certificate
----
OpenSSL provides a command line interface, that can be used to create the
certificate file required by civetweb (server.pem).
One can use the following steps in Windows (in Linux replace "copy" by "cp"
and "type" by "cat"):
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
copy server.key server.key.orig
openssl rsa -in server.key.orig -out server.key
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
copy server.crt server.pem
type server.key >> server.pem
The server.pem should look like this (x represents BASE64 encoded data):
-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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