|
1 # |
|
2 # This is the Apache server configuration file providing SSL support using. |
|
3 # the mod_nss plugin. It contains the configuration directives to instruct |
|
4 # the server how to serve pages over an https connection. |
|
5 # |
|
6 # Do NOT simply read the instructions in here without understanding |
|
7 # what they do. They're here only as hints or reminders. If you are unsure |
|
8 # consult the online docs. You have been warned. |
|
9 # |
|
10 |
|
11 #LoadModule nss_module modules/libmodnss.so |
|
12 |
|
13 # |
|
14 # When we also provide SSL we have to listen to the |
|
15 # standard HTTP port (see above) and to the HTTPS port |
|
16 # |
|
17 # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two |
|
18 # Listen directives: "Listen [::]:8443" and "Listen 0.0.0.0:443" |
|
19 # |
|
20 Listen 8443 |
|
21 |
|
22 ## |
|
23 ## SSL Global Context |
|
24 ## |
|
25 ## All SSL configuration in this context applies both to |
|
26 ## the main server and all SSL-enabled virtual hosts. |
|
27 ## |
|
28 |
|
29 # |
|
30 # Some MIME-types for downloading Certificates and CRLs |
|
31 # |
|
32 AddType application/x-x509-ca-cert .crt |
|
33 AddType application/x-pkcs7-crl .crl |
|
34 |
|
35 # Pass Phrase Dialog: |
|
36 # Configure the pass phrase gathering process. |
|
37 # The filtering dialog program (`builtin' is a internal |
|
38 # terminal dialog) has to provide the pass phrase on stdout. |
|
39 <% if @passwd_file -%> |
|
40 NSSPassPhraseDialog "file:<%= @passwd_file %>" |
|
41 <% else -%> |
|
42 NSSPassPhraseDialog builtin |
|
43 <% end -%> |
|
44 |
|
45 # Pass Phrase Helper: |
|
46 # This helper program stores the token password pins between |
|
47 # restarts of Apache. |
|
48 NSSPassPhraseHelper /usr/sbin/nss_pcache |
|
49 |
|
50 # Configure the SSL Session Cache. |
|
51 # NSSSessionCacheSize is the number of entries in the cache. |
|
52 # NSSSessionCacheTimeout is the SSL2 session timeout (in seconds). |
|
53 # NSSSession3CacheTimeout is the SSL3/TLS session timeout (in seconds). |
|
54 NSSSessionCacheSize 10000 |
|
55 NSSSessionCacheTimeout 100 |
|
56 NSSSession3CacheTimeout 86400 |
|
57 |
|
58 # |
|
59 # Pseudo Random Number Generator (PRNG): |
|
60 # Configure one or more sources to seed the PRNG of the SSL library. |
|
61 # The seed data should be of good random quality. |
|
62 # WARNING! On some platforms /dev/random blocks if not enough entropy |
|
63 # is available. Those platforms usually also provide a non-blocking |
|
64 # device, /dev/urandom, which may be used instead. |
|
65 # |
|
66 # This does not support seeding the RNG with each connection. |
|
67 |
|
68 NSSRandomSeed startup builtin |
|
69 #NSSRandomSeed startup file:/dev/random 512 |
|
70 #NSSRandomSeed startup file:/dev/urandom 512 |
|
71 |
|
72 # |
|
73 # TLS Negotiation configuration under RFC 5746 |
|
74 # |
|
75 # Only renegotiate if the peer's hello bears the TLS renegotiation_info |
|
76 # extension. Default off. |
|
77 NSSRenegotiation off |
|
78 |
|
79 # Peer must send Signaling Cipher Suite Value (SCSV) or |
|
80 # Renegotiation Info (RI) extension in ALL handshakes. Default: off |
|
81 NSSRequireSafeNegotiation off |
|
82 |
|
83 ## |
|
84 ## SSL Virtual Host Context |
|
85 ## |
|
86 |
|
87 <VirtualHost _default_:8443> |
|
88 |
|
89 # General setup for the virtual host |
|
90 #DocumentRoot "/etc/httpd/htdocs" |
|
91 #ServerName www.example.com:8443 |
|
92 #ServerAdmin you@example.com |
|
93 |
|
94 # mod_nss can log to separate log files, you can choose to do that if you'd like |
|
95 # LogLevel is not inherited from httpd.conf. |
|
96 ErrorLog "<%= @error_log %>" |
|
97 TransferLog "<%= @transfer_log %>" |
|
98 LogLevel warn |
|
99 |
|
100 # SSL Engine Switch: |
|
101 # Enable/Disable SSL for this virtual host. |
|
102 NSSEngine on |
|
103 |
|
104 # SSL Cipher Suite: |
|
105 # List the ciphers that the client is permitted to negotiate. |
|
106 # See the mod_nss documentation for a complete list. |
|
107 |
|
108 # SSL 3 ciphers. SSL 2 is disabled by default. |
|
109 NSSCipherSuite +rsa_rc4_128_md5,+rsa_rc4_128_sha,+rsa_3des_sha,-rsa_des_sha,-rsa_rc4_40_md5,-rsa_rc2_40_md5,-rsa_null_md5,-rsa_null_sha,+fips_3des_sha,-fips_des_sha,-fortezza,-fortezza_rc4_128_sha,-fortezza_null,-rsa_des_56_sha,-rsa_rc4_56_sha,+rsa_aes_128_sha,+rsa_aes_256_sha |
|
110 |
|
111 # SSL 3 ciphers + ECC ciphers. SSL 2 is disabled by default. |
|
112 # |
|
113 # Comment out the NSSCipherSuite line above and use the one below if you have |
|
114 # ECC enabled NSS and mod_nss and want to use Elliptical Curve Cryptography |
|
115 #NSSCipherSuite +rsa_rc4_128_md5,+rsa_rc4_128_sha,+rsa_3des_sha,-rsa_des_sha,-rsa_rc4_40_md5,-rsa_rc2_40_md5,-rsa_null_md5,-rsa_null_sha,+fips_3des_sha,-fips_des_sha,-fortezza,-fortezza_rc4_128_sha,-fortezza_null,-rsa_des_56_sha,-rsa_rc4_56_sha,+rsa_aes_128_sha,+rsa_aes_256_sha,-ecdh_ecdsa_null_sha,+ecdh_ecdsa_rc4_128_sha,+ecdh_ecdsa_3des_sha,+ecdh_ecdsa_aes_128_sha,+ecdh_ecdsa_aes_256_sha,-ecdhe_ecdsa_null_sha,+ecdhe_ecdsa_rc4_128_sha,+ecdhe_ecdsa_3des_sha,+ecdhe_ecdsa_aes_128_sha,+ecdhe_ecdsa_aes_256_sha,-ecdh_rsa_null_sha,+ecdh_rsa_128_sha,+ecdh_rsa_3des_sha,+ecdh_rsa_aes_128_sha,+ecdh_rsa_aes_256_sha,-echde_rsa_null,+ecdhe_rsa_rc4_128_sha,+ecdhe_rsa_3des_sha,+ecdhe_rsa_aes_128_sha,+ecdhe_rsa_aes_256_sha |
|
116 |
|
117 # SSL Protocol: |
|
118 # Cryptographic protocols that provide communication security. |
|
119 # NSS handles the specified protocols as "ranges", and automatically |
|
120 # negotiates the use of the strongest protocol for a connection starting |
|
121 # with the maximum specified protocol and downgrading as necessary to the |
|
122 # minimum specified protocol that can be used between two processes. |
|
123 # Since all protocol ranges are completely inclusive, and no protocol in the |
|
124 # middle of a range may be excluded, the entry "NSSProtocol SSLv3,TLSv1.1" |
|
125 # is identical to the entry "NSSProtocol SSLv3,TLSv1.0,TLSv1.1". |
|
126 NSSProtocol SSLv3,TLSv1.0,TLSv1.1 |
|
127 |
|
128 # SSL Certificate Nickname: |
|
129 # The nickname of the RSA server certificate you are going to use. |
|
130 NSSNickname Server-Cert |
|
131 |
|
132 # SSL Certificate Nickname: |
|
133 # The nickname of the ECC server certificate you are going to use, if you |
|
134 # have an ECC-enabled version of NSS and mod_nss |
|
135 #NSSECCNickname Server-Cert-ecc |
|
136 |
|
137 # Server Certificate Database: |
|
138 # The NSS security database directory that holds the certificates and |
|
139 # keys. The database consists of 3 files: cert8.db, key3.db and secmod.db. |
|
140 # Provide the directory that these files exist. |
|
141 NSSCertificateDatabase "<%= @httpd_dir -%>/alias" |
|
142 |
|
143 # Database Prefix: |
|
144 # In order to be able to store multiple NSS databases in one directory |
|
145 # they need unique names. This option sets the database prefix used for |
|
146 # cert8.db and key3.db. |
|
147 #NSSDBPrefix my-prefix- |
|
148 |
|
149 # Client Authentication (Type): |
|
150 # Client certificate verification type. Types are none, optional and |
|
151 # require. |
|
152 #NSSVerifyClient none |
|
153 |
|
154 # |
|
155 # Online Certificate Status Protocol (OCSP). |
|
156 # Verify that certificates have not been revoked before accepting them. |
|
157 #NSSOCSP off |
|
158 |
|
159 # |
|
160 # Use a default OCSP responder. If enabled this will be used regardless |
|
161 # of whether one is included in a client certificate. Note that the |
|
162 # server certificate is verified during startup. |
|
163 # |
|
164 # NSSOCSPDefaultURL defines the service URL of the OCSP responder |
|
165 # NSSOCSPDefaultName is the nickname of the certificate to trust to |
|
166 # sign the OCSP responses. |
|
167 #NSSOCSPDefaultResponder on |
|
168 #NSSOCSPDefaultURL http://example.com/ocsp/status |
|
169 #NSSOCSPDefaultName ocsp-nickname |
|
170 |
|
171 # Access Control: |
|
172 # With SSLRequire you can do per-directory access control based |
|
173 # on arbitrary complex boolean expressions containing server |
|
174 # variable checks and other lookup directives. The syntax is a |
|
175 # mixture between C and Perl. See the mod_nss documentation |
|
176 # for more details. |
|
177 #<Location /> |
|
178 #NSSRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \ |
|
179 # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \ |
|
180 # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \ |
|
181 # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \ |
|
182 # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \ |
|
183 # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/ |
|
184 #</Location> |
|
185 |
|
186 # SSL Engine Options: |
|
187 # Set various options for the SSL engine. |
|
188 # o FakeBasicAuth: |
|
189 # Translate the client X.509 into a Basic Authorisation. This means that |
|
190 # the standard Auth/DBMAuth methods can be used for access control. The |
|
191 # user name is the `one line' version of the client's X.509 certificate. |
|
192 # Note that no password is obtained from the user. Every entry in the user |
|
193 # file needs this password: `xxj31ZMTZzkVA'. |
|
194 # o ExportCertData: |
|
195 # This exports two additional environment variables: SSL_CLIENT_CERT and |
|
196 # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the |
|
197 # server (always existing) and the client (only existing when client |
|
198 # authentication is used). This can be used to import the certificates |
|
199 # into CGI scripts. |
|
200 # o StdEnvVars: |
|
201 # This exports the standard SSL/TLS related `SSL_*' environment variables. |
|
202 # Per default this exportation is switched off for performance reasons, |
|
203 # because the extraction step is an expensive operation and is usually |
|
204 # useless for serving static content. So one usually enables the |
|
205 # exportation for CGI and SSI requests only. |
|
206 # o StrictRequire: |
|
207 # This denies access when "NSSRequireSSL" or "NSSRequire" applied even |
|
208 # under a "Satisfy any" situation, i.e. when it applies access is denied |
|
209 # and no other module can change it. |
|
210 # o OptRenegotiate: |
|
211 # This enables optimized SSL connection renegotiation handling when SSL |
|
212 # directives are used in per-directory context. |
|
213 #NSSOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire |
|
214 <FilesMatch "\.(cgi|shtml|phtml|php3?)$"> |
|
215 NSSOptions +StdEnvVars |
|
216 </FilesMatch> |
|
217 <Directory "/var/www/cgi-bin"> |
|
218 NSSOptions +StdEnvVars |
|
219 </Directory> |
|
220 |
|
221 # Per-Server Logging: |
|
222 # The home of a custom SSL log file. Use this when you want a |
|
223 # compact non-error SSL logfile on a virtual host basis. |
|
224 #CustomLog /home/rcrit/redhat/apache/logs/ssl_request_log \ |
|
225 # "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" |
|
226 |
|
227 </VirtualHost> |
|
228 |