]>
Commit | Line | Data |
---|---|---|
a2151c5b | 1 | =pod |
625c781d | 2 | {- OpenSSL::safe::output_do_not_edit_headers(); -} |
9fcb9702 | 3 | |
a2151c5b DSH |
4 | =head1 NAME |
5 | ||
b6b66573 | 6 | openssl-s_server - SSL/TLS server program |
a2151c5b DSH |
7 | |
8 | =head1 SYNOPSIS | |
9 | ||
a2bbe594 | 10 | B<openssl> B<s_server> |
169394d4 | 11 | [B<-help>] |
e8769719 RS |
12 | [B<-port> I<+int>] |
13 | [B<-accept> I<val>] | |
14 | [B<-unix> I<val>] | |
a22f9c84 E |
15 | [B<-4>] |
16 | [B<-6>] | |
0bae1960 | 17 | [B<-unlink>] |
e8769719 RS |
18 | [B<-context> I<val>] |
19 | [B<-verify> I<int>] | |
20 | [B<-Verify> I<int>] | |
21 | [B<-cert> I<infile>] | |
2b264aee | 22 | [B<-cert2> I<infile>] |
6d382c74 | 23 | [B<-certform> B<DER>|B<PEM>|B<P12>] |
2b264aee DDO |
24 | [B<-cert_chain> I<infile>] |
25 | [B<-build_chain>] | |
26 | [B<-serverinfo> I<val>] | |
f91d003a RL |
27 | [B<-key> I<filename>|I<uri>] |
28 | [B<-key2> I<filename>|I<uri>] | |
6d382c74 | 29 | [B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>] |
e8769719 RS |
30 | [B<-pass> I<val>] |
31 | [B<-dcert> I<infile>] | |
6d382c74 | 32 | [B<-dcertform> B<DER>|B<PEM>|B<P12>] |
2b264aee | 33 | [B<-dcert_chain> I<infile>] |
f91d003a | 34 | [B<-dkey> I<filename>|I<uri>] |
6d382c74 | 35 | [B<-dkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>] |
e8769719 | 36 | [B<-dpass> I<val>] |
a2151c5b DSH |
37 | [B<-nbio_test>] |
38 | [B<-crlf>] | |
39 | [B<-debug>] | |
1d8634b1 | 40 | [B<-msg>] |
e8769719 | 41 | [B<-msgfile> I<outfile>] |
a2151c5b | 42 | [B<-state>] |
0bae1960 MC |
43 | [B<-nocert>] |
44 | [B<-quiet>] | |
45 | [B<-no_resume_ephemeral>] | |
46 | [B<-www>] | |
47 | [B<-WWW>] | |
8b3efb53 | 48 | [B<-http_server_binmode>] |
90fc2c26 | 49 | [B<-no_ca_names>] |
09b90e0e | 50 | [B<-ignore_unexpected_eof>] |
0bae1960 MC |
51 | [B<-servername>] |
52 | [B<-servername_fatal>] | |
0bae1960 MC |
53 | [B<-tlsextdebug>] |
54 | [B<-HTTP>] | |
e8769719 | 55 | [B<-id_prefix> I<val>] |
e8769719 RS |
56 | [B<-keymatexport> I<val>] |
57 | [B<-keymatexportlen> I<+int>] | |
58 | [B<-CRL> I<infile>] | |
2b264aee | 59 | [B<-CRLform> B<DER>|B<PEM>] |
0bae1960 | 60 | [B<-crl_download>] |
2b264aee | 61 | [B<-chainCAfile> I<infile>] |
e8769719 | 62 | [B<-chainCApath> I<dir>] |
fd3397fc | 63 | [B<-chainCAstore> I<uri>] |
2b264aee DDO |
64 | [B<-verifyCAfile> I<infile>] |
65 | [B<-verifyCApath> I<dir>] | |
fd3397fc | 66 | [B<-verifyCAstore> I<uri>] |
0bae1960 MC |
67 | [B<-no_cache>] |
68 | [B<-ext_cache>] | |
0bae1960 MC |
69 | [B<-verify_return_error>] |
70 | [B<-verify_quiet>] | |
0bae1960 MC |
71 | [B<-ign_eof>] |
72 | [B<-no_ign_eof>] | |
4832560b | 73 | [B<-no_etm>] |
0bae1960 MC |
74 | [B<-status>] |
75 | [B<-status_verbose>] | |
e8769719 | 76 | [B<-status_timeout> I<int>] |
80a4ac57 DDO |
77 | [B<-proxy> I<[http[s]://][userinfo@]host[:port][/path]>] |
78 | [B<-no_proxy> I<addresses>] | |
e8769719 RS |
79 | [B<-status_url> I<val>] |
80 | [B<-status_file> I<infile>] | |
359efeac | 81 | [B<-ssl_config> I<val>] |
0bae1960 MC |
82 | [B<-trace>] |
83 | [B<-security_debug>] | |
84 | [B<-security_debug_verbose>] | |
85 | [B<-brief>] | |
86 | [B<-rev>] | |
87 | [B<-async>] | |
e8769719 RS |
88 | [B<-max_send_frag> I<+int>] |
89 | [B<-split_send_frag> I<+int>] | |
90 | [B<-max_pipelines> I<+int>] | |
2b264aee | 91 | [B<-naccept> I<+int>] |
e8769719 | 92 | [B<-read_buf> I<+int>] |
0bae1960 MC |
93 | [B<-bugs>] |
94 | [B<-no_comp>] | |
95 | [B<-comp>] | |
96 | [B<-no_ticket>] | |
97 | [B<-serverpref>] | |
98 | [B<-legacy_renegotiation>] | |
99 | [B<-no_renegotiation>] | |
0bae1960 MC |
100 | [B<-no_resumption_on_reneg>] |
101 | [B<-no_legacy_server_connect>] | |
4e2bd9cb | 102 | [B<-allow_no_dhe_kex>] |
e1c7871d | 103 | [B<-prioritize_chacha>] |
0bae1960 | 104 | [B<-strict>] |
e8769719 RS |
105 | [B<-sigalgs> I<val>] |
106 | [B<-client_sigalgs> I<val>] | |
107 | [B<-groups> I<val>] | |
108 | [B<-curves> I<val>] | |
109 | [B<-named_curve> I<val>] | |
110 | [B<-cipher> I<val>] | |
111 | [B<-ciphersuites> I<val>] | |
112 | [B<-dhparam> I<infile>] | |
113 | [B<-record_padding> I<val>] | |
0bae1960 | 114 | [B<-debug_broken_protocol>] |
0bae1960 | 115 | [B<-nbio>] |
e8769719 RS |
116 | [B<-psk_identity> I<val>] |
117 | [B<-psk_hint> I<val>] | |
118 | [B<-psk> I<val>] | |
119 | [B<-psk_session> I<file>] | |
120 | [B<-srpvfile> I<infile>] | |
121 | [B<-srpuserseed> I<val>] | |
0bae1960 | 122 | [B<-timeout>] |
e8769719 | 123 | [B<-mtu> I<+int>] |
0bae1960 | 124 | [B<-listen>] |
19044d3c | 125 | [B<-sctp>] |
09d62b33 | 126 | [B<-sctp_label_bug>] |
359efeac | 127 | [B<-use_srtp> I<val>] |
a2151c5b | 128 | [B<-no_dhe>] |
e8769719 | 129 | [B<-nextprotoneg> I<val>] |
e8769719 | 130 | [B<-alpn> I<val>] |
cd81ac7b | 131 | [B<-sendfile>] |
e8769719 | 132 | [B<-keylogfile> I<outfile>] |
65718c51 | 133 | [B<-recv_max_early_data> I<int>] |
8b3efb53 | 134 | [B<-max_early_data> I<int>] |
6437b802 | 135 | [B<-early_data>] |
65718c51 | 136 | [B<-stateless>] |
3bb5e5b0 MC |
137 | [B<-anti_replay>] |
138 | [B<-no_anti_replay>] | |
8b3efb53 | 139 | [B<-num_tickets>] |
bc24e3ee | 140 | {- $OpenSSL::safe::opt_name_synopsis -} |
d4bff20d | 141 | {- $OpenSSL::safe::opt_version_synopsis -} |
21d08b9e | 142 | {- $OpenSSL::safe::opt_v_synopsis -} |
8b3efb53 | 143 | {- $OpenSSL::safe::opt_s_synopsis -} |
9fcb9702 RS |
144 | {- $OpenSSL::safe::opt_x_synopsis -} |
145 | {- $OpenSSL::safe::opt_trust_synopsis -} | |
146 | {- $OpenSSL::safe::opt_r_synopsis -} | |
d55e4487 | 147 | {- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_provider_synopsis -} |
7efd0e77 | 148 | |
a2151c5b DSH |
149 | =head1 DESCRIPTION |
150 | ||
35a810bb RL |
151 | This command implements a generic SSL/TLS server which |
152 | listens for connections on a given port using SSL/TLS. | |
a2151c5b DSH |
153 | |
154 | =head1 OPTIONS | |
155 | ||
35a810bb RL |
156 | In addition to the options below, this command also supports |
157 | the common and server only options documented | |
f5c14c63 | 158 | L<SSL_CONF_cmd(3)/Supported Command Line Commands> |
765b4137 | 159 | |
a2151c5b DSH |
160 | =over 4 |
161 | ||
169394d4 MR |
162 | =item B<-help> |
163 | ||
164 | Print out a usage message. | |
165 | ||
e8769719 | 166 | =item B<-port> I<+int> |
a2151c5b | 167 | |
8c73aeb6 | 168 | The TCP port to listen on for connections. If not specified 4433 is used. |
a2151c5b | 169 | |
e8769719 | 170 | =item B<-accept> I<val> |
a22f9c84 E |
171 | |
172 | The optional TCP host and port to listen on for connections. If not specified, *:4433 is used. | |
173 | ||
e8769719 | 174 | =item B<-unix> I<val> |
a22f9c84 E |
175 | |
176 | Unix domain socket to accept on. | |
177 | ||
a22f9c84 E |
178 | =item B<-4> |
179 | ||
180 | Use IPv4 only. | |
181 | ||
182 | =item B<-6> | |
183 | ||
184 | Use IPv6 only. | |
185 | ||
0bae1960 MC |
186 | =item B<-unlink> |
187 | ||
188 | For -unix, unlink any existing socket first. | |
189 | ||
e8769719 | 190 | =item B<-context> I<val> |
a2151c5b | 191 | |
8c73aeb6 | 192 | Sets the SSL context id. It can be given any string value. If this option |
cc8709a0 | 193 | is not present a default value will be used. |
a2151c5b | 194 | |
e8769719 | 195 | =item B<-verify> I<int>, B<-Verify> I<int> |
0bae1960 MC |
196 | |
197 | The verify depth to use. This specifies the maximum length of the | |
198 | client certificate chain and makes the server request a certificate from | |
199 | the client. With the B<-verify> option a certificate is requested but the | |
200 | client does not have to send one, with the B<-Verify> option the client | |
201 | must supply a certificate or an error occurs. | |
202 | ||
203 | If the cipher suite cannot request a client certificate (for example an | |
204 | anonymous cipher suite or PSK) this option has no effect. | |
205 | ||
e8769719 | 206 | =item B<-cert> I<infile> |
a2151c5b DSH |
207 | |
208 | The certificate to use, most servers cipher suites require the use of a | |
209 | certificate and some require a certificate with a certain public key type: | |
210 | for example the DSS cipher suites require a certificate containing a DSS | |
1948394d | 211 | (DSA) key. If not specified then the filename F<server.pem> will be used. |
a2151c5b | 212 | |
f91d003a RL |
213 | =item B<-cert2> I<infile> |
214 | ||
215 | The certificate file to use for servername; default is C<server2.pem>. | |
216 | ||
6d382c74 | 217 | =item B<-certform> B<DER>|B<PEM>|B<P12> |
2b264aee | 218 | |
bee3f389 TM |
219 | The server certificate file format; unspecified by default. |
220 | See L<openssl-format-options(1)> for details. | |
2b264aee | 221 | |
7cacbe9d DB |
222 | =item B<-cert_chain> |
223 | ||
b3c5aadf | 224 | A file or URI of untrusted certificates to use when attempting to build the |
2b264aee | 225 | certificate chain related to the certificate specified via the B<-cert> option. |
b3c5aadf | 226 | The input can be in PEM, DER, or PKCS#12 format. |
7cacbe9d DB |
227 | |
228 | =item B<-build_chain> | |
229 | ||
2b264aee | 230 | Specify whether the application should build the server certificate chain to be |
7cacbe9d DB |
231 | provided to the client. |
232 | ||
e8769719 | 233 | =item B<-serverinfo> I<val> |
0bae1960 MC |
234 | |
235 | A file containing one or more blocks of PEM data. Each PEM block | |
236 | must encode a TLS ServerHello extension (2 bytes type, 2 bytes length, | |
237 | followed by "length" bytes of extension data). If the client sends | |
238 | an empty TLS ClientHello extension matching the type, the corresponding | |
239 | ServerHello extension will be returned. | |
240 | ||
f91d003a | 241 | =item B<-key> I<filename>|I<uri> |
a2151c5b DSH |
242 | |
243 | The private key to use. If not specified then the certificate file will | |
244 | be used. | |
245 | ||
f91d003a RL |
246 | =item B<-key2> I<filename>|I<uri> |
247 | ||
248 | The private Key file to use for servername if not given via B<-cert2>. | |
249 | ||
6d382c74 | 250 | =item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE> |
826a42a0 | 251 | |
bee3f389 | 252 | The key format; unspecified by default. |
46949153 | 253 | See L<openssl-format-options(1)> for details. |
826a42a0 | 254 | |
e8769719 | 255 | =item B<-pass> I<val> |
826a42a0 | 256 | |
2a33470b | 257 | The private key and certificate file password source. |
777182a0 | 258 | For more information about the format of I<val>, |
46949153 | 259 | see L<openssl-passphrase-options(1)>. |
826a42a0 | 260 | |
f91d003a | 261 | =item B<-dcert> I<infile>, B<-dkey> I<filename>|I<uri> |
a2151c5b | 262 | |
8c73aeb6 | 263 | Specify an additional certificate and private key, these behave in the |
a2151c5b DSH |
264 | same manner as the B<-cert> and B<-key> options except there is no default |
265 | if they are not specified (no additional certificate and key is used). As | |
266 | noted above some cipher suites require a certificate containing a key of | |
267 | a certain type. Some cipher suites need a certificate carrying an RSA key | |
268 | and some a DSS (DSA) key. By using RSA and DSS certificates and keys | |
269 | a server can support clients which only support RSA or DSS cipher suites | |
270 | by using an appropriate certificate. | |
271 | ||
7cacbe9d DB |
272 | =item B<-dcert_chain> |
273 | ||
b3c5aadf | 274 | A file or URI of untrusted certificates to use when attempting to build the |
7cacbe9d DB |
275 | server certificate chain when a certificate specified via the B<-dcert> option |
276 | is in use. | |
b3c5aadf | 277 | The input can be in PEM, DER, or PKCS#12 format. |
7cacbe9d | 278 | |
6d382c74 | 279 | =item B<-dcertform> B<DER>|B<PEM>|B<P12> |
2b264aee | 280 | |
bee3f389 TM |
281 | The format of the additional certificate file; unspecified by default. |
282 | See L<openssl-format-options(1)> for details. | |
2b264aee | 283 | |
6d382c74 | 284 | =item B<-dkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE> |
777182a0 | 285 | |
bee3f389 TM |
286 | The format of the additional private key; unspecified by default. |
287 | See L<openssl-format-options(1)> for details. | |
826a42a0 | 288 | |
777182a0 RS |
289 | =item B<-dpass> I<val> |
290 | ||
2a33470b | 291 | The passphrase for the additional private key and certificate. |
777182a0 | 292 | For more information about the format of I<val>, |
46949153 | 293 | see L<openssl-passphrase-options(1)>. |
826a42a0 | 294 | |
0bae1960 | 295 | =item B<-nbio_test> |
a2151c5b | 296 | |
0bae1960 | 297 | Tests non blocking I/O. |
a2151c5b | 298 | |
0bae1960 | 299 | =item B<-crlf> |
a2151c5b | 300 | |
0bae1960 | 301 | This option translated a line feed from the terminal into CR+LF. |
a2151c5b | 302 | |
0bae1960 | 303 | =item B<-debug> |
a2151c5b | 304 | |
0bae1960 | 305 | Print extensive debugging information including a hex dump of all traffic. |
a2151c5b | 306 | |
359efeac DDO |
307 | =item B<-security_debug> |
308 | ||
309 | Print output from SSL/TLS security framework. | |
310 | ||
311 | =item B<-security_debug_verbose> | |
312 | ||
313 | Print more output from SSL/TLS security framework | |
314 | ||
0bae1960 | 315 | =item B<-msg> |
51e00db2 | 316 | |
0bae1960 | 317 | Show all protocol messages with hex dump. |
51e00db2 | 318 | |
e8769719 | 319 | =item B<-msgfile> I<outfile> |
a2151c5b | 320 | |
0bae1960 | 321 | File to send output of B<-msg> or B<-trace> to, default standard output. |
a2151c5b | 322 | |
0bae1960 MC |
323 | =item B<-state> |
324 | ||
325 | Prints the SSL session states. | |
326 | ||
2b264aee DDO |
327 | =item B<-CRL> I<infile> |
328 | ||
329 | The CRL file to use. | |
330 | ||
331 | =item B<-CRLform> B<DER>|B<PEM> | |
332 | ||
bee3f389 | 333 | The CRL file format; unspecified by default. |
46949153 | 334 | See L<openssl-format-options(1)> for details. |
2b264aee DDO |
335 | |
336 | =item B<-crl_download> | |
337 | ||
338 | Download CRLs from distribution points given in CDP extensions of certificates | |
7cacbe9d | 339 | |
2b264aee DDO |
340 | =item B<-verifyCAfile> I<filename> |
341 | ||
342 | A file in PEM format CA containing trusted certificates to use | |
343 | for verifying client certificates. | |
344 | ||
345 | =item B<-verifyCApath> I<dir> | |
346 | ||
347 | A directory containing trusted certificates to use | |
348 | for verifying client certificates. | |
349 | This directory must be in "hash format", | |
350 | see L<openssl-verify(1)> for more information. | |
351 | ||
352 | =item B<-verifyCAstore> I<uri> | |
353 | ||
354 | The URI of a store containing trusted certificates to use | |
355 | for verifying client certificates. | |
7cacbe9d | 356 | |
e8769719 | 357 | =item B<-chainCAfile> I<file> |
7cacbe9d | 358 | |
2b264aee DDO |
359 | A file in PEM format containing trusted certificates to use |
360 | when attempting to build the server certificate chain. | |
361 | ||
362 | =item B<-chainCApath> I<dir> | |
363 | ||
364 | A directory containing trusted certificates to use | |
365 | for building the server certificate chain provided to the client. | |
366 | This directory must be in "hash format", | |
367 | see L<openssl-verify(1)> for more information. | |
7cacbe9d | 368 | |
fd3397fc RL |
369 | =item B<-chainCAstore> I<uri> |
370 | ||
2b264aee DDO |
371 | The URI of a store containing trusted certificates to use |
372 | for building the server certificate chain provided to the client. | |
373 | The URI may indicate a single certificate, as well as a collection of them. | |
fd3397fc RL |
374 | With URIs in the C<file:> scheme, this acts as B<-chainCAfile> or |
375 | B<-chainCApath>, depending on if the URI indicates a directory or a | |
376 | single file. | |
377 | See L<ossl_store-file(7)> for more information on the C<file:> scheme. | |
378 | ||
0bae1960 | 379 | =item B<-nocert> |
8d419330 | 380 | |
0bae1960 MC |
381 | If this option is set then no certificate is used. This restricts the |
382 | cipher suites available to the anonymous ones (currently just anonymous | |
383 | DH). | |
8d419330 | 384 | |
0bae1960 | 385 | =item B<-quiet> |
a2151c5b | 386 | |
0bae1960 | 387 | Inhibit printing of session and certificate information. |
a2151c5b | 388 | |
359efeac DDO |
389 | =item B<-no_resume_ephemeral> |
390 | ||
391 | Disable caching and tickets if ephemeral (EC)DH is used. | |
392 | ||
0b3b2b33 RS |
393 | =item B<-tlsextdebug> |
394 | ||
395 | Print a hex dump of any TLS extensions received from the server. | |
396 | ||
0bae1960 | 397 | =item B<-www> |
a2151c5b | 398 | |
0bae1960 MC |
399 | Sends a status message back to the client when it connects. This includes |
400 | information about the ciphers used and various session parameters. | |
0b3b2b33 RS |
401 | The output is in HTML format so this option can be used with a web browser. |
402 | The special URL C</renegcert> turns on client cert validation, and C</reneg> | |
403 | tells the server to request renegotiation. | |
404 | The B<-early_data> option cannot be used with this option. | |
a2151c5b | 405 | |
0b3b2b33 | 406 | =item B<-WWW>, B<-HTTP> |
1d8634b1 | 407 | |
0bae1960 | 408 | Emulates a simple web server. Pages will be resolved relative to the |
0b3b2b33 RS |
409 | current directory, for example if the URL C<https://myhost/page.html> is |
410 | requested the file F<./page.html> will be sent. | |
411 | If the B<-HTTP> flag is used, the files are sent directly, and should contain | |
412 | any HTTP response headers (including status response line). | |
413 | If the B<-WWW> option is used, | |
414 | the response headers are generated by the server, and the file extension is | |
415 | examined to determine the B<Content-Type> header. | |
416 | Extensions of C<html>, C<htm>, and C<php> are C<text/html> and all others are | |
417 | C<text/plain>. | |
418 | In addition, the special URL C</stats> will return status | |
419 | information like the B<-www> option. | |
420 | Neither of these options can be used in conjunction with B<-early_data>. | |
8dbeb110 | 421 | |
8b3efb53 RS |
422 | =item B<-http_server_binmode> |
423 | ||
424 | When acting as web-server (using option B<-WWW> or B<-HTTP>) open files requested | |
425 | by the client in binary mode. | |
426 | ||
90fc2c26 NM |
427 | =item B<-no_ca_names> |
428 | ||
429 | Disable TLS Extension CA Names. You may want to disable it for security reasons | |
430 | or for compatibility with some Windows TLS implementations crashing when this | |
431 | extension is larger than 1024 bytes. | |
432 | ||
09b90e0e DB |
433 | =item B<-ignore_unexpected_eof> |
434 | ||
435 | Some TLS implementations do not send the mandatory close_notify alert on | |
436 | shutdown. If the application tries to wait for the close_notify alert but the | |
437 | peer closes the connection without sending it, an error is generated. When this | |
438 | option is enabled the peer does not need to send the close_notify alert and a | |
439 | closed connection will be treated as if the close_notify alert was received. | |
440 | For more information on shutting down a connection, see L<SSL_shutdown(3)>. | |
441 | ||
359efeac DDO |
442 | =item B<-servername> |
443 | ||
444 | Servername for HostName TLS extension. | |
445 | ||
446 | =item B<-servername_fatal> | |
447 | ||
448 | On servername mismatch send fatal alert (default: warning alert). | |
449 | ||
e8769719 | 450 | =item B<-id_prefix> I<val> |
a2151c5b | 451 | |
2f0ea936 | 452 | Generate SSL/TLS session IDs prefixed by I<val>. This is mostly useful |
8c1cbc72 | 453 | for testing any SSL/TLS code (e.g. proxies) that wish to deal with multiple |
0bae1960 | 454 | servers, when each of which might be generating a unique range of session |
8c1cbc72 | 455 | IDs (e.g. with a certain prefix). |
a2151c5b | 456 | |
359efeac DDO |
457 | =item B<-keymatexport> |
458 | ||
459 | Export keying material using label. | |
460 | ||
461 | =item B<-keymatexportlen> | |
462 | ||
463 | Export the given number of bytes of keying material; default 20. | |
464 | ||
465 | =item B<-no_cache> | |
466 | ||
467 | Disable session cache. | |
468 | ||
469 | =item B<-ext_cache>. | |
470 | ||
471 | Disable internal cache, set up and use external cache. | |
472 | ||
0bae1960 | 473 | =item B<-verify_return_error> |
a2151c5b | 474 | |
0bae1960 MC |
475 | Verification errors normally just print a message but allow the |
476 | connection to continue, for debugging purposes. | |
477 | If this option is used, then verification errors close the connection. | |
a2151c5b | 478 | |
359efeac DDO |
479 | =item B<-verify_quiet> |
480 | ||
481 | No verify output except verify errors. | |
482 | ||
483 | =item B<-ign_eof> | |
484 | ||
485 | Ignore input EOF (default: when B<-quiet>). | |
486 | ||
487 | =item B<-no_ign_eof> | |
488 | ||
489 | Do not ignore input EOF. | |
490 | ||
4832560b DB |
491 | =item B<-no_etm> |
492 | ||
493 | Disable Encrypt-then-MAC negotiation. | |
494 | ||
0bae1960 | 495 | =item B<-status> |
a2151c5b | 496 | |
0bae1960 | 497 | Enables certificate status request support (aka OCSP stapling). |
a2151c5b | 498 | |
0bae1960 | 499 | =item B<-status_verbose> |
ddac1974 | 500 | |
0bae1960 MC |
501 | Enables certificate status request support (aka OCSP stapling) and gives |
502 | a verbose printout of the OCSP response. | |
ddac1974 | 503 | |
e8769719 | 504 | =item B<-status_timeout> I<int> |
720b6cbe | 505 | |
2f0ea936 | 506 | Sets the timeout for OCSP response to I<int> seconds. |
720b6cbe | 507 | |
80a4ac57 DDO |
508 | =item B<-proxy> I<[http[s]://][userinfo@]host[:port][/path]> |
509 | ||
510 | The HTTP(S) proxy server to use for reaching the OCSP server unless B<-no_proxy> | |
511 | applies, see below. | |
512 | The proxy port defaults to 80 or 443 if the scheme is C<https>; apart from that | |
513 | the optional C<http://> or C<https://> prefix is ignored, | |
514 | as well as any userinfo and path components. | |
515 | Defaults to the environment variable C<http_proxy> if set, else C<HTTP_PROXY> | |
516 | in case no TLS is used, otherwise C<https_proxy> if set, else C<HTTPS_PROXY>. | |
517 | ||
518 | =item B<-no_proxy> I<addresses> | |
519 | ||
520 | List of IP addresses and/or DNS names of servers | |
521 | not to use an HTTP(S) proxy for, separated by commas and/or whitespace | |
522 | (where in the latter case the whole argument must be enclosed in "..."). | |
523 | Default is from the environment variable C<no_proxy> if set, else C<NO_PROXY>. | |
524 | ||
e8769719 | 525 | =item B<-status_url> I<val> |
ddac1974 | 526 | |
0bae1960 MC |
527 | Sets a fallback responder URL to use if no responder URL is present in the |
528 | server certificate. Without this option an error is returned if the server | |
529 | certificate does not contain a responder address. | |
7932982b DDO |
530 | The optional userinfo and fragment URL components are ignored. |
531 | Any given query component is handled as part of the path component. | |
ddac1974 | 532 | |
e8769719 | 533 | =item B<-status_file> I<infile> |
a2151c5b | 534 | |
0bae1960 MC |
535 | Overrides any OCSP responder URLs from the certificate and always provides the |
536 | OCSP Response stored in the file. The file must be in DER format. | |
a2151c5b | 537 | |
359efeac DDO |
538 | =item B<-ssl_config> I<val> |
539 | ||
540 | Configure SSL_CTX using the given configuration value. | |
541 | ||
0bae1960 | 542 | =item B<-trace> |
35d15a39 | 543 | |
726f92e0 | 544 | Show verbose trace output of protocol messages. |
35d15a39 | 545 | |
0bae1960 | 546 | =item B<-brief> |
35d15a39 | 547 | |
0bae1960 MC |
548 | Provide a brief summary of connection parameters instead of the normal verbose |
549 | output. | |
35d15a39 | 550 | |
0bae1960 | 551 | =item B<-rev> |
19044d3c | 552 | |
04fb4ec8 HK |
553 | Simple echo server that sends back received text reversed. Also sets B<-brief>. |
554 | Cannot be used in conjunction with B<-early_data>. | |
19044d3c | 555 | |
bc8857bf MC |
556 | =item B<-async> |
557 | ||
8c73aeb6 | 558 | Switch on asynchronous mode. Cryptographic operations will be performed |
bc8857bf MC |
559 | asynchronously. This will only have an effect if an asynchronous capable engine |
560 | is also used via the B<-engine> option. For test purposes the dummy async engine | |
561 | (dasync) can be used (if available). | |
562 | ||
e8769719 | 563 | =item B<-max_send_frag> I<+int> |
28e5ea88 F |
564 | |
565 | The maximum size of data fragment to send. | |
566 | See L<SSL_CTX_set_max_send_fragment(3)> for further information. | |
567 | ||
e8769719 | 568 | =item B<-split_send_frag> I<+int> |
0df80881 MC |
569 | |
570 | The size used to split data for encrypt pipelines. If more data is written in | |
571 | one go than this value then it will be split into multiple pipelines, up to the | |
572 | maximum number of pipelines defined by max_pipelines. This only has an effect if | |
c4de074e | 573 | a suitable cipher suite has been negotiated, an engine that supports pipelining |
0df80881 MC |
574 | has been loaded, and max_pipelines is greater than 1. See |
575 | L<SSL_CTX_set_split_send_fragment(3)> for further information. | |
576 | ||
e8769719 | 577 | =item B<-max_pipelines> I<+int> |
0df80881 MC |
578 | |
579 | The maximum number of encrypt/decrypt pipelines to be used. This will only have | |
580 | an effect if an engine has been loaded that supports pipelining (e.g. the dasync | |
c4de074e | 581 | engine) and a suitable cipher suite has been negotiated. The default value is 1. |
0df80881 MC |
582 | See L<SSL_CTX_set_max_pipelines(3)> for further information. |
583 | ||
2b264aee DDO |
584 | =item B<-naccept> I<+int> |
585 | ||
586 | The server will exit after receiving the specified number of connections, | |
587 | default unlimited. | |
588 | ||
e8769719 | 589 | =item B<-read_buf> I<+int> |
0df80881 MC |
590 | |
591 | The default read buffer size to be used for connections. This will only have an | |
592 | effect if the buffer size is larger than the size that would otherwise be used | |
593 | and pipelining is in use (see L<SSL_CTX_set_default_read_buffer_len(3)> for | |
594 | further information). | |
595 | ||
a2151c5b DSH |
596 | =item B<-bugs> |
597 | ||
fc4e500b | 598 | There are several known bugs in SSL and TLS implementations. Adding this |
a2151c5b DSH |
599 | option enables various workarounds. |
600 | ||
0bae1960 MC |
601 | =item B<-no_comp> |
602 | ||
603 | Disable negotiation of TLS compression. | |
604 | TLS compression is not recommended and is off by default as of | |
605 | OpenSSL 1.1.0. | |
606 | ||
cc5a9ba4 VD |
607 | =item B<-comp> |
608 | ||
609 | Enable negotiation of TLS compression. | |
610 | This option was introduced in OpenSSL 1.1.0. | |
611 | TLS compression is not recommended and is off by default as of | |
612 | OpenSSL 1.1.0. | |
613 | ||
0bae1960 | 614 | =item B<-no_ticket> |
cc5a9ba4 | 615 | |
7ffb7fbe MC |
616 | Disable RFC4507bis session ticket support. This option has no effect if TLSv1.3 |
617 | is negotiated. See B<-num_tickets>. | |
618 | ||
619 | =item B<-num_tickets> | |
620 | ||
621 | Control the number of tickets that will be sent to the client after a full | |
622 | handshake in TLSv1.3. The default number of tickets is 2. This option does not | |
623 | affect the number of tickets sent after a resumption handshake. | |
cc5a9ba4 | 624 | |
0bae1960 | 625 | =item B<-serverpref> |
765b4137 | 626 | |
0bae1960 MC |
627 | Use the server's cipher preferences, rather than the client's preferences. |
628 | ||
e1c7871d TS |
629 | =item B<-prioritize_chacha> |
630 | ||
631 | Prioritize ChaCha ciphers when preferred by clients. Requires B<-serverpref>. | |
632 | ||
0bae1960 MC |
633 | =item B<-no_resumption_on_reneg> |
634 | ||
635 | Set the B<SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION> option. | |
765b4137 | 636 | |
e8769719 | 637 | =item B<-client_sigalgs> I<val> |
254b58fd SC |
638 | |
639 | Signature algorithms to support for client certificate authentication | |
c4de074e | 640 | (colon-separated list). |
254b58fd | 641 | |
e8769719 | 642 | =item B<-named_curve> I<val> |
254b58fd SC |
643 | |
644 | Specifies the elliptic curve to use. NOTE: this is single curve, not a list. | |
645 | For a list of all possible curves, use: | |
646 | ||
647 | $ openssl ecparam -list_curves | |
648 | ||
e8769719 | 649 | =item B<-cipher> I<val> |
a2151c5b | 650 | |
9d2674cd MC |
651 | This allows the list of TLSv1.2 and below ciphersuites used by the server to be |
652 | modified. This list is combined with any TLSv1.3 ciphersuites that have been | |
653 | configured. When the client sends a list of supported ciphers the first client | |
654 | cipher also included in the server list is used. Because the client specifies | |
655 | the preference order, the order of the server cipherlist is irrelevant. See | |
35a810bb | 656 | L<openssl-ciphers(1)> for more information. |
a2151c5b | 657 | |
e8769719 | 658 | =item B<-ciphersuites> I<val> |
9d2674cd MC |
659 | |
660 | This allows the list of TLSv1.3 ciphersuites used by the server to be modified. | |
661 | This list is combined with any TLSv1.2 and below ciphersuites that have been | |
662 | configured. When the client sends a list of supported ciphers the first client | |
663 | cipher also included in the server list is used. Because the client specifies | |
664 | the preference order, the order of the server cipherlist is irrelevant. See | |
35a810bb RL |
665 | L<openssl-ciphers(1)> command for more information. The format for this list is |
666 | a simple colon (":") separated list of TLSv1.3 ciphersuite names. | |
9d2674cd | 667 | |
e8769719 | 668 | =item B<-dhparam> I<infile> |
7b825005 | 669 | |
0bae1960 MC |
670 | The DH parameter file to use. The ephemeral DH cipher suites generate keys |
671 | using a set of DH parameters. If not specified then an attempt is made to | |
672 | load the parameters from the server certificate file. | |
35a810bb RL |
673 | If this fails then a static set of parameters hard coded into this command |
674 | will be used. | |
765b4137 | 675 | |
0bae1960 | 676 | =item B<-nbio> |
52b621db | 677 | |
0bae1960 | 678 | Turns on non blocking I/O. |
52b621db | 679 | |
359efeac DDO |
680 | =item B<-timeout> |
681 | ||
682 | Enable timeouts. | |
683 | ||
684 | =item B<-mtu> | |
685 | ||
686 | Set link-layer MTU. | |
687 | ||
e8769719 | 688 | =item B<-psk_identity> I<val> |
9cd50f73 | 689 | |
2f0ea936 | 690 | Expect the client to send PSK identity I<val> when using a PSK |
0bae1960 MC |
691 | cipher suite, and warn if they do not. By default, the expected PSK |
692 | identity is the string "Client_identity". | |
9cd50f73 | 693 | |
e8769719 | 694 | =item B<-psk_hint> I<val> |
36086186 | 695 | |
2f0ea936 | 696 | Use the PSK identity hint I<val> when using a PSK cipher suite. |
36086186 | 697 | |
e8769719 | 698 | =item B<-psk> I<val> |
cba3f1c7 | 699 | |
2f0ea936 | 700 | Use the PSK key I<val> when using a PSK cipher suite. The key is |
0bae1960 MC |
701 | given as a hexadecimal number without leading 0x, for example -psk |
702 | 1a2b3c4d. | |
703 | This option must be provided in order to use a PSK cipher. | |
cba3f1c7 | 704 | |
e8769719 | 705 | =item B<-psk_session> I<file> |
9e064bc1 | 706 | |
2f0ea936 | 707 | Use the pem encoded SSL_SESSION data stored in I<file> as the basis of a PSK. |
9e064bc1 MC |
708 | Note that this will only work if TLSv1.3 is negotiated. |
709 | ||
359efeac DDO |
710 | =item B<-srpvfile> |
711 | ||
712 | The verifier file for SRP. | |
713 | This option is deprecated. | |
714 | ||
715 | =item B<-srpuserseed> | |
716 | ||
717 | A seed string for a default user salt. | |
718 | This option is deprecated. | |
719 | ||
0bae1960 | 720 | =item B<-listen> |
cba3f1c7 | 721 | |
0bae1960 | 722 | This option can only be used in conjunction with one of the DTLS options above. |
35a810bb RL |
723 | With this option, this command will listen on a UDP port for incoming |
724 | connections. | |
0bae1960 MC |
725 | Any ClientHellos that arrive will be checked to see if they have a cookie in |
726 | them or not. | |
727 | Any without a cookie will be responded to with a HelloVerifyRequest. | |
35a810bb RL |
728 | If a ClientHello with a cookie is received then this command will |
729 | connect to that peer and complete the handshake. | |
cba3f1c7 | 730 | |
0bae1960 | 731 | =item B<-sctp> |
cba3f1c7 | 732 | |
0bae1960 MC |
733 | Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in |
734 | conjunction with B<-dtls>, B<-dtls1> or B<-dtls1_2>. This option is only | |
735 | available where OpenSSL has support for SCTP enabled. | |
cba3f1c7 | 736 | |
09d62b33 MT |
737 | =item B<-sctp_label_bug> |
738 | ||
739 | Use the incorrect behaviour of older OpenSSL implementations when computing | |
740 | endpoint-pair shared secrets for DTLS/SCTP. This allows communication with | |
741 | older broken implementations but breaks interoperability with correct | |
742 | implementations. Must be used in conjunction with B<-sctp>. This option is only | |
743 | available where OpenSSL has support for SCTP enabled. | |
744 | ||
359efeac DDO |
745 | =item B<-use_srtp> |
746 | ||
747 | Offer SRTP key management with a colon-separated profile list. | |
748 | ||
0bae1960 | 749 | =item B<-no_dhe> |
acf65ae5 | 750 | |
0bae1960 MC |
751 | If this option is set then no DH parameters will be loaded effectively |
752 | disabling the ephemeral DH cipher suites. | |
acf65ae5 | 753 | |
e8769719 | 754 | =item B<-alpn> I<val>, B<-nextprotoneg> I<val> |
7efd0e77 | 755 | |
dd28d1c4 | 756 | These flags enable the Application-Layer Protocol Negotiation |
c4de074e P |
757 | or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the |
758 | IETF standard and replaces NPN. | |
2f0ea936 | 759 | The I<val> list is a comma-separated list of supported protocol |
c4de074e | 760 | names. The list should contain the most desirable protocols first. |
7efd0e77 HK |
761 | Protocol names are printable ASCII strings, for example "http/1.1" or |
762 | "spdy/3". | |
837f87c2 | 763 | The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used. |
7efd0e77 | 764 | |
cd81ac7b TZ |
765 | =item B<-sendfile> |
766 | ||
767 | If this option is set and KTLS is enabled, SSL_sendfile() will be used | |
768 | instead of BIO_write() to send the HTTP response requested by a client. | |
769 | This option is only valid if B<-WWW> or B<-HTTP> is specified. | |
770 | ||
e8769719 | 771 | =item B<-keylogfile> I<outfile> |
39176d44 PW |
772 | |
773 | Appends TLS secrets to the specified keylog file such that external programs | |
774 | (like Wireshark) can decrypt TLS connections. | |
775 | ||
e8769719 | 776 | =item B<-max_early_data> I<int> |
6437b802 MC |
777 | |
778 | Change the default maximum early data bytes that are specified for new sessions | |
779 | and any incoming early data (when used in conjunction with the B<-early_data> | |
83750d9b MC |
780 | flag). The default value is approximately 16k. The argument must be an integer |
781 | greater than or equal to 0. | |
6437b802 | 782 | |
65718c51 RS |
783 | =item B<-recv_max_early_data> I<int> |
784 | ||
785 | Specify the hard limit on the maximum number of early data bytes that will | |
786 | be accepted. | |
787 | ||
6437b802 MC |
788 | =item B<-early_data> |
789 | ||
6ef40f1f MC |
790 | Accept early data where possible. Cannot be used in conjunction with B<-www>, |
791 | B<-WWW>, B<-HTTP> or B<-rev>. | |
6437b802 | 792 | |
65718c51 RS |
793 | =item B<-stateless> |
794 | ||
795 | Require TLSv1.3 cookies. | |
796 | ||
3bb5e5b0 MC |
797 | =item B<-anti_replay>, B<-no_anti_replay> |
798 | ||
799 | Switches replay protection on or off, respectively. Replay protection is on by | |
800 | default unless overridden by a configuration file. When it is on, OpenSSL will | |
801 | automatically detect if a session ticket has been used more than once, TLSv1.3 | |
802 | has been negotiated, and early data is enabled on the server. A full handshake | |
803 | is forced if a session ticket is used a second or subsequent time. Any early | |
804 | data that was sent will be rejected. | |
805 | ||
bc24e3ee RS |
806 | {- $OpenSSL::safe::opt_name_item -} |
807 | ||
d4bff20d RS |
808 | {- $OpenSSL::safe::opt_version_item -} |
809 | ||
8b3efb53 RS |
810 | {- $OpenSSL::safe::opt_s_item -} |
811 | ||
9fcb9702 RS |
812 | {- $OpenSSL::safe::opt_x_item -} |
813 | ||
814 | {- $OpenSSL::safe::opt_trust_item -} | |
815 | ||
816 | {- $OpenSSL::safe::opt_r_item -} | |
817 | ||
018aaeb4 RS |
818 | {- $OpenSSL::safe::opt_engine_item -} |
819 | ||
6bd4e3f2 P |
820 | {- $OpenSSL::safe::opt_provider_item -} |
821 | ||
21d08b9e RS |
822 | {- $OpenSSL::safe::opt_v_item -} |
823 | ||
824 | If the server requests a client certificate, then | |
825 | verification errors are displayed, for debugging, but the command will | |
826 | proceed unless the B<-verify_return_error> option is used. | |
827 | ||
a2151c5b DSH |
828 | =back |
829 | ||
830 | =head1 CONNECTED COMMANDS | |
831 | ||
832 | If a connection request is established with an SSL client and neither the | |
4b08eaf5 | 833 | B<-www> nor the B<-WWW> option has been used then normally any data received |
8c73aeb6 | 834 | from the client is displayed and any key presses will be sent to the client. |
4b08eaf5 | 835 | |
3d0dde84 MC |
836 | Certain commands are also recognized which perform special operations. These |
837 | commands are a letter which must appear at the start of a line. They are listed | |
838 | below. | |
4b08eaf5 DSH |
839 | |
840 | =over 4 | |
841 | ||
842 | =item B<q> | |
843 | ||
c4de074e | 844 | End the current SSL connection but still accept new connections. |
4b08eaf5 DSH |
845 | |
846 | =item B<Q> | |
847 | ||
c4de074e | 848 | End the current SSL connection and exit. |
4b08eaf5 DSH |
849 | |
850 | =item B<r> | |
851 | ||
3d0dde84 | 852 | Renegotiate the SSL session (TLSv1.2 and below only). |
4b08eaf5 DSH |
853 | |
854 | =item B<R> | |
855 | ||
3d0dde84 MC |
856 | Renegotiate the SSL session and request a client certificate (TLSv1.2 and below |
857 | only). | |
4b08eaf5 DSH |
858 | |
859 | =item B<P> | |
860 | ||
c4de074e | 861 | Send some plain text down the underlying TCP connection: this should |
4b08eaf5 DSH |
862 | cause the client to disconnect due to a protocol violation. |
863 | ||
864 | =item B<S> | |
865 | ||
c4de074e | 866 | Print out some session cache status information. |
4b08eaf5 | 867 | |
3d0dde84 MC |
868 | =item B<k> |
869 | ||
870 | Send a key update message to the client (TLSv1.3 only) | |
871 | ||
872 | =item B<K> | |
873 | ||
874 | Send a key update message to the client and request one back (TLSv1.3 only) | |
875 | ||
876 | =item B<c> | |
877 | ||
878 | Send a certificate request to the client (TLSv1.3 only) | |
879 | ||
4b08eaf5 | 880 | =back |
a2151c5b DSH |
881 | |
882 | =head1 NOTES | |
883 | ||
35a810bb RL |
884 | This command can be used to debug SSL clients. To accept connections |
885 | from a web browser the command: | |
a2151c5b DSH |
886 | |
887 | openssl s_server -accept 443 -www | |
888 | ||
889 | can be used for example. | |
890 | ||
a2151c5b | 891 | Although specifying an empty list of CAs when requesting a client certificate |
4b08eaf5 DSH |
892 | is strictly speaking a protocol violation, some SSL clients interpret this to |
893 | mean any CA is acceptable. This is useful for debugging purposes. | |
a2151c5b | 894 | |
35a810bb | 895 | The session parameters can printed out using the L<openssl-sess_id(1)> command. |
a2151c5b DSH |
896 | |
897 | =head1 BUGS | |
898 | ||
8c73aeb6 | 899 | Because this program has a lot of options and also because some of the |
35a810bb RL |
900 | techniques used are rather old, the C source for this command is rather |
901 | hard to read and not a model of how things should be done. | |
8c73aeb6 | 902 | A typical SSL server program would be much simpler. |
a2151c5b DSH |
903 | |
904 | The output of common ciphers is wrong: it just gives the list of ciphers that | |
4b08eaf5 | 905 | OpenSSL recognizes and the client supports. |
a2151c5b | 906 | |
35a810bb RL |
907 | There should be a way for this command to print out details |
908 | of any unknown cipher suites a client says it supports. | |
a2151c5b DSH |
909 | |
910 | =head1 SEE ALSO | |
911 | ||
b6b66573 DMSP |
912 | L<openssl(1)>, |
913 | L<openssl-sess_id(1)>, | |
914 | L<openssl-s_client(1)>, | |
915 | L<openssl-ciphers(1)>, | |
916 | L<SSL_CONF_cmd(3)>, | |
dfee8626 RS |
917 | L<SSL_CTX_set_max_send_fragment(3)>, |
918 | L<SSL_CTX_set_split_send_fragment(3)>, | |
fd3397fc RL |
919 | L<SSL_CTX_set_max_pipelines(3)>, |
920 | L<ossl_store-file(7)> | |
a2151c5b | 921 | |
fa7b0111 MC |
922 | =head1 HISTORY |
923 | ||
fc5ecadd | 924 | The -no_alt_chains option was added in OpenSSL 1.1.0. |
e1c7871d | 925 | |
fc5ecadd DMSP |
926 | The |
927 | -allow-no-dhe-kex and -prioritize_chacha options were added in OpenSSL 1.1.1. | |
fa7b0111 | 928 | |
359efeac DDO |
929 | The B<-srpvfile>, B<-srpuserseed>, and B<-engine> |
930 | option were deprecated in OpenSSL 3.0. | |
0f221d9c | 931 | |
e2f92610 RS |
932 | =head1 COPYRIGHT |
933 | ||
8020d79b | 934 | Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 935 | |
449040b4 | 936 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
937 | this file except in compliance with the License. You can obtain a copy |
938 | in the file LICENSE in the source distribution or at | |
939 | L<https://www.openssl.org/source/license.html>. | |
940 | ||
941 | =cut |