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