openssl-s_server.pod.in 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. =pod
  2. {- OpenSSL::safe::output_do_not_edit_headers(); -}
  3. =head1 NAME
  4. openssl-s_server - SSL/TLS server program
  5. =head1 SYNOPSIS
  6. B<openssl> B<s_server>
  7. [B<-help>]
  8. [B<-port> I<+int>]
  9. [B<-accept> I<val>]
  10. [B<-unix> I<val>]
  11. [B<-4>]
  12. [B<-6>]
  13. [B<-unlink>]
  14. [B<-context> I<val>]
  15. [B<-verify> I<int>]
  16. [B<-Verify> I<int>]
  17. [B<-cert> I<infile>]
  18. [B<-cert2> I<infile>]
  19. [B<-certform> B<DER>|B<PEM>|B<P12>]
  20. [B<-cert_chain> I<infile>]
  21. [B<-build_chain>]
  22. [B<-serverinfo> I<val>]
  23. [B<-key> I<infile>]
  24. [B<-key2> I<infile>]
  25. [B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
  26. [B<-pass> I<val>]
  27. [B<-dcert> I<infile>]
  28. [B<-dcertform> B<DER>|B<PEM>|B<P12>]
  29. [B<-dcert_chain> I<infile>]
  30. [B<-dkey> I<infile>]
  31. [B<-dkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
  32. [B<-dpass> I<val>]
  33. [B<-nbio_test>]
  34. [B<-crlf>]
  35. [B<-debug>]
  36. [B<-msg>]
  37. [B<-msgfile> I<outfile>]
  38. [B<-state>]
  39. [B<-nocert>]
  40. [B<-quiet>]
  41. [B<-no_resume_ephemeral>]
  42. [B<-www>]
  43. [B<-WWW>]
  44. [B<-http_server_binmode>]
  45. [B<-no_ca_names>]
  46. [B<-ignore_unexpected_eof>]
  47. [B<-servername>]
  48. [B<-servername_fatal>]
  49. [B<-tlsextdebug>]
  50. [B<-HTTP>]
  51. [B<-id_prefix> I<val>]
  52. [B<-keymatexport> I<val>]
  53. [B<-keymatexportlen> I<+int>]
  54. [B<-CRL> I<infile>]
  55. [B<-CRLform> B<DER>|B<PEM>]
  56. [B<-crl_download>]
  57. [B<-chainCAfile> I<infile>]
  58. [B<-chainCApath> I<dir>]
  59. [B<-chainCAstore> I<uri>]
  60. [B<-verifyCAfile> I<infile>]
  61. [B<-verifyCApath> I<dir>]
  62. [B<-verifyCAstore> I<uri>]
  63. [B<-no_cache>]
  64. [B<-ext_cache>]
  65. [B<-verify_return_error>]
  66. [B<-verify_quiet>]
  67. [B<-ign_eof>]
  68. [B<-no_ign_eof>]
  69. [B<-status>]
  70. [B<-status_verbose>]
  71. [B<-status_timeout> I<int>]
  72. [B<-status_url> I<val>]
  73. [B<-status_file> I<infile>]
  74. [B<-trace>]
  75. [B<-security_debug>]
  76. [B<-security_debug_verbose>]
  77. [B<-brief>]
  78. [B<-rev>]
  79. [B<-async>]
  80. [B<-ssl_config> I<val>]
  81. [B<-max_send_frag> I<+int>]
  82. [B<-split_send_frag> I<+int>]
  83. [B<-max_pipelines> I<+int>]
  84. [B<-naccept> I<+int>]
  85. [B<-read_buf> I<+int>]
  86. [B<-bugs>]
  87. [B<-no_comp>]
  88. [B<-comp>]
  89. [B<-no_ticket>]
  90. [B<-serverpref>]
  91. [B<-legacy_renegotiation>]
  92. [B<-no_renegotiation>]
  93. [B<-legacy_server_connect>]
  94. [B<-no_resumption_on_reneg>]
  95. [B<-no_legacy_server_connect>]
  96. [B<-allow_no_dhe_kex>]
  97. [B<-prioritize_chacha>]
  98. [B<-strict>]
  99. [B<-sigalgs> I<val>]
  100. [B<-client_sigalgs> I<val>]
  101. [B<-groups> I<val>]
  102. [B<-curves> I<val>]
  103. [B<-named_curve> I<val>]
  104. [B<-cipher> I<val>]
  105. [B<-ciphersuites> I<val>]
  106. [B<-dhparam> I<infile>]
  107. [B<-record_padding> I<val>]
  108. [B<-debug_broken_protocol>]
  109. [B<-nbio>]
  110. [B<-psk_identity> I<val>]
  111. [B<-psk_hint> I<val>]
  112. [B<-psk> I<val>]
  113. [B<-psk_session> I<file>]
  114. [B<-srpvfile> I<infile>]
  115. [B<-srpuserseed> I<val>]
  116. [B<-timeout>]
  117. [B<-mtu> I<+int>]
  118. [B<-listen>]
  119. [B<-sctp>]
  120. [B<-sctp_label_bug>]
  121. [B<-no_dhe>]
  122. [B<-nextprotoneg> I<val>]
  123. [B<-use_srtp> I<val>]
  124. [B<-alpn> I<val>]
  125. [B<-sendfile>]
  126. [B<-keylogfile> I<outfile>]
  127. [B<-recv_max_early_data> I<int>]
  128. [B<-max_early_data> I<int>]
  129. [B<-early_data>]
  130. [B<-stateless>]
  131. [B<-anti_replay>]
  132. [B<-no_anti_replay>]
  133. [B<-num_tickets>]
  134. {- $OpenSSL::safe::opt_name_synopsis -}
  135. {- $OpenSSL::safe::opt_version_synopsis -}
  136. {- $OpenSSL::safe::opt_v_synopsis -}
  137. {- $OpenSSL::safe::opt_s_synopsis -}
  138. {- $OpenSSL::safe::opt_x_synopsis -}
  139. {- $OpenSSL::safe::opt_trust_synopsis -}
  140. {- $OpenSSL::safe::opt_r_synopsis -}
  141. {- $OpenSSL::safe::opt_engine_synopsis -}
  142. {- $OpenSSL::safe::opt_provider_synopsis -}
  143. =for openssl ifdef unix 4 6 unlink no_dhe nextprotoneg use_srtp engine
  144. =for openssl ifdef status status_verbose status_timeout status_url status_file
  145. =for openssl ifdef psk_hint srpvfile srpuserseed sctp sctp_label_bug
  146. =for openssl ifdef sctp sctp_label_bug trace mtu timeout listen
  147. =for openssl ifdef ssl3 tls1 tls1_1 tls1_2 tls1_3 dtls mtu dtls1 dtls1_2
  148. =for openssl ifdef sendfile
  149. =head1 DESCRIPTION
  150. This command implements a generic SSL/TLS server which
  151. listens for connections on a given port using SSL/TLS.
  152. =head1 OPTIONS
  153. In addition to the options below, this command also supports
  154. the common and server only options documented
  155. L<SSL_CONF_cmd(3)/Supported Command Line Commands>
  156. =over 4
  157. =item B<-help>
  158. Print out a usage message.
  159. =item B<-port> I<+int>
  160. The TCP port to listen on for connections. If not specified 4433 is used.
  161. =item B<-accept> I<val>
  162. The optional TCP host and port to listen on for connections. If not specified, *:4433 is used.
  163. =item B<-unix> I<val>
  164. Unix domain socket to accept on.
  165. =item B<-4>
  166. Use IPv4 only.
  167. =item B<-6>
  168. Use IPv6 only.
  169. =item B<-unlink>
  170. For -unix, unlink any existing socket first.
  171. =item B<-context> I<val>
  172. Sets the SSL context id. It can be given any string value. If this option
  173. is not present a default value will be used.
  174. =item B<-verify> I<int>, B<-Verify> I<int>
  175. The verify depth to use. This specifies the maximum length of the
  176. client certificate chain and makes the server request a certificate from
  177. the client. With the B<-verify> option a certificate is requested but the
  178. client does not have to send one, with the B<-Verify> option the client
  179. must supply a certificate or an error occurs.
  180. If the cipher suite cannot request a client certificate (for example an
  181. anonymous cipher suite or PSK) this option has no effect.
  182. =item B<-cert> I<infile>
  183. The certificate to use, most servers cipher suites require the use of a
  184. certificate and some require a certificate with a certain public key type:
  185. for example the DSS cipher suites require a certificate containing a DSS
  186. (DSA) key. If not specified then the filename F<server.pem> will be used.
  187. =item B<-certform> B<DER>|B<PEM>|B<P12>
  188. The server certificate file format.
  189. This option has no effect and is retained for backward compatibility only.
  190. =item B<-cert_chain>
  191. A file or URI of untrusted certificates to use when attempting to build the
  192. certificate chain related to the certificate specified via the B<-cert> option.
  193. The input can be in PEM, DER, or PKCS#12 format.
  194. =item B<-build_chain>
  195. Specify whether the application should build the server certificate chain to be
  196. provided to the client.
  197. =item B<-serverinfo> I<val>
  198. A file containing one or more blocks of PEM data. Each PEM block
  199. must encode a TLS ServerHello extension (2 bytes type, 2 bytes length,
  200. followed by "length" bytes of extension data). If the client sends
  201. an empty TLS ClientHello extension matching the type, the corresponding
  202. ServerHello extension will be returned.
  203. =item B<-key> I<infile>
  204. The private key to use. If not specified then the certificate file will
  205. be used.
  206. =item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
  207. The key format; the default is B<PEM>.
  208. The only value with effect is B<ENGINE>; all others have become obsolete.
  209. See L<openssl(1)/Format Options> for details.
  210. =item B<-pass> I<val>
  211. The private key and certificate file password source.
  212. For more information about the format of I<val>,
  213. see L<openssl(1)/Pass Phrase Options>.
  214. =item B<-dcert> I<infile>, B<-dkey> I<infile>
  215. Specify an additional certificate and private key, these behave in the
  216. same manner as the B<-cert> and B<-key> options except there is no default
  217. if they are not specified (no additional certificate and key is used). As
  218. noted above some cipher suites require a certificate containing a key of
  219. a certain type. Some cipher suites need a certificate carrying an RSA key
  220. and some a DSS (DSA) key. By using RSA and DSS certificates and keys
  221. a server can support clients which only support RSA or DSS cipher suites
  222. by using an appropriate certificate.
  223. =item B<-dcert_chain>
  224. A file or URI of untrusted certificates to use when attempting to build the
  225. server certificate chain when a certificate specified via the B<-dcert> option
  226. is in use.
  227. The input can be in PEM, DER, or PKCS#12 format.
  228. =item B<-dcertform> B<DER>|B<PEM>|B<P12>
  229. The format of the additional certificate file.
  230. This option has no effect and is retained for backward compatibility only.
  231. =item B<-dkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
  232. The format of the additional private key; the default is B<PEM>.
  233. The only value with effect is B<ENGINE>; all others have become obsolete.
  234. See L<openssl(1)/Format Options>.
  235. =item B<-dpass> I<val>
  236. The passphrase for the additional private key and certificate.
  237. For more information about the format of I<val>,
  238. see L<openssl(1)/Pass Phrase Options>.
  239. =item B<-nbio_test>
  240. Tests non blocking I/O.
  241. =item B<-crlf>
  242. This option translated a line feed from the terminal into CR+LF.
  243. =item B<-debug>
  244. Print extensive debugging information including a hex dump of all traffic.
  245. =item B<-msg>
  246. Show all protocol messages with hex dump.
  247. =item B<-msgfile> I<outfile>
  248. File to send output of B<-msg> or B<-trace> to, default standard output.
  249. =item B<-state>
  250. Prints the SSL session states.
  251. =item B<-CRL> I<infile>
  252. The CRL file to use.
  253. =item B<-CRLform> B<DER>|B<PEM>
  254. The CRL file format; the default is B<PEM>.
  255. See L<openssl(1)/Format Options> for details.
  256. =item B<-crl_download>
  257. Download CRLs from distribution points given in CDP extensions of certificates
  258. =item B<-verifyCAfile> I<filename>
  259. A file in PEM format CA containing trusted certificates to use
  260. for verifying client certificates.
  261. =item B<-verifyCApath> I<dir>
  262. A directory containing trusted certificates to use
  263. for verifying client certificates.
  264. This directory must be in "hash format",
  265. see L<openssl-verify(1)> for more information.
  266. =item B<-verifyCAstore> I<uri>
  267. The URI of a store containing trusted certificates to use
  268. for verifying client certificates.
  269. =item B<-chainCAfile> I<file>
  270. A file in PEM format containing trusted certificates to use
  271. when attempting to build the server certificate chain.
  272. =item B<-chainCApath> I<dir>
  273. A directory containing trusted certificates to use
  274. for building the server certificate chain provided to the client.
  275. This directory must be in "hash format",
  276. see L<openssl-verify(1)> for more information.
  277. =item B<-chainCAstore> I<uri>
  278. The URI of a store containing trusted certificates to use
  279. for building the server certificate chain provided to the client.
  280. The URI may indicate a single certificate, as well as a collection of them.
  281. With URIs in the C<file:> scheme, this acts as B<-chainCAfile> or
  282. B<-chainCApath>, depending on if the URI indicates a directory or a
  283. single file.
  284. See L<ossl_store-file(7)> for more information on the C<file:> scheme.
  285. =item B<-nocert>
  286. If this option is set then no certificate is used. This restricts the
  287. cipher suites available to the anonymous ones (currently just anonymous
  288. DH).
  289. =item B<-quiet>
  290. Inhibit printing of session and certificate information.
  291. =item B<-tlsextdebug>
  292. Print a hex dump of any TLS extensions received from the server.
  293. =item B<-www>
  294. Sends a status message back to the client when it connects. This includes
  295. information about the ciphers used and various session parameters.
  296. The output is in HTML format so this option can be used with a web browser.
  297. The special URL C</renegcert> turns on client cert validation, and C</reneg>
  298. tells the server to request renegotiation.
  299. The B<-early_data> option cannot be used with this option.
  300. =item B<-WWW>, B<-HTTP>
  301. Emulates a simple web server. Pages will be resolved relative to the
  302. current directory, for example if the URL C<https://myhost/page.html> is
  303. requested the file F<./page.html> will be sent.
  304. If the B<-HTTP> flag is used, the files are sent directly, and should contain
  305. any HTTP response headers (including status response line).
  306. If the B<-WWW> option is used,
  307. the response headers are generated by the server, and the file extension is
  308. examined to determine the B<Content-Type> header.
  309. Extensions of C<html>, C<htm>, and C<php> are C<text/html> and all others are
  310. C<text/plain>.
  311. In addition, the special URL C</stats> will return status
  312. information like the B<-www> option.
  313. Neither of these options can be used in conjunction with B<-early_data>.
  314. =item B<-http_server_binmode>
  315. When acting as web-server (using option B<-WWW> or B<-HTTP>) open files requested
  316. by the client in binary mode.
  317. =item B<-no_ca_names>
  318. Disable TLS Extension CA Names. You may want to disable it for security reasons
  319. or for compatibility with some Windows TLS implementations crashing when this
  320. extension is larger than 1024 bytes.
  321. =item B<-ignore_unexpected_eof>
  322. Some TLS implementations do not send the mandatory close_notify alert on
  323. shutdown. If the application tries to wait for the close_notify alert but the
  324. peer closes the connection without sending it, an error is generated. When this
  325. option is enabled the peer does not need to send the close_notify alert and a
  326. closed connection will be treated as if the close_notify alert was received.
  327. For more information on shutting down a connection, see L<SSL_shutdown(3)>.
  328. =item B<-id_prefix> I<val>
  329. Generate SSL/TLS session IDs prefixed by I<val>. This is mostly useful
  330. for testing any SSL/TLS code (e.g. proxies) that wish to deal with multiple
  331. servers, when each of which might be generating a unique range of session
  332. IDs (e.g. with a certain prefix).
  333. =item B<-verify_return_error>
  334. Verification errors normally just print a message but allow the
  335. connection to continue, for debugging purposes.
  336. If this option is used, then verification errors close the connection.
  337. =item B<-status>
  338. Enables certificate status request support (aka OCSP stapling).
  339. =item B<-status_verbose>
  340. Enables certificate status request support (aka OCSP stapling) and gives
  341. a verbose printout of the OCSP response.
  342. =item B<-status_timeout> I<int>
  343. Sets the timeout for OCSP response to I<int> seconds.
  344. =item B<-status_url> I<val>
  345. Sets a fallback responder URL to use if no responder URL is present in the
  346. server certificate. Without this option an error is returned if the server
  347. certificate does not contain a responder address.
  348. =item B<-status_file> I<infile>
  349. Overrides any OCSP responder URLs from the certificate and always provides the
  350. OCSP Response stored in the file. The file must be in DER format.
  351. =item B<-trace>
  352. Show verbose trace output of protocol messages. OpenSSL needs to be compiled
  353. with B<enable-ssl-trace> for this option to work.
  354. =item B<-brief>
  355. Provide a brief summary of connection parameters instead of the normal verbose
  356. output.
  357. =item B<-rev>
  358. Simple test server which just reverses the text received from the client
  359. and sends it back to the server. Also sets B<-brief>. Cannot be used in
  360. conjunction with B<-early_data>.
  361. =item B<-async>
  362. Switch on asynchronous mode. Cryptographic operations will be performed
  363. asynchronously. This will only have an effect if an asynchronous capable engine
  364. is also used via the B<-engine> option. For test purposes the dummy async engine
  365. (dasync) can be used (if available).
  366. =item B<-max_send_frag> I<+int>
  367. The maximum size of data fragment to send.
  368. See L<SSL_CTX_set_max_send_fragment(3)> for further information.
  369. =item B<-split_send_frag> I<+int>
  370. The size used to split data for encrypt pipelines. If more data is written in
  371. one go than this value then it will be split into multiple pipelines, up to the
  372. maximum number of pipelines defined by max_pipelines. This only has an effect if
  373. a suitable cipher suite has been negotiated, an engine that supports pipelining
  374. has been loaded, and max_pipelines is greater than 1. See
  375. L<SSL_CTX_set_split_send_fragment(3)> for further information.
  376. =item B<-max_pipelines> I<+int>
  377. The maximum number of encrypt/decrypt pipelines to be used. This will only have
  378. an effect if an engine has been loaded that supports pipelining (e.g. the dasync
  379. engine) and a suitable cipher suite has been negotiated. The default value is 1.
  380. See L<SSL_CTX_set_max_pipelines(3)> for further information.
  381. =item B<-naccept> I<+int>
  382. The server will exit after receiving the specified number of connections,
  383. default unlimited.
  384. =item B<-read_buf> I<+int>
  385. The default read buffer size to be used for connections. This will only have an
  386. effect if the buffer size is larger than the size that would otherwise be used
  387. and pipelining is in use (see L<SSL_CTX_set_default_read_buffer_len(3)> for
  388. further information).
  389. =item B<-bugs>
  390. There are several known bugs in SSL and TLS implementations. Adding this
  391. option enables various workarounds.
  392. =item B<-no_comp>
  393. Disable negotiation of TLS compression.
  394. TLS compression is not recommended and is off by default as of
  395. OpenSSL 1.1.0.
  396. =item B<-comp>
  397. Enable negotiation of TLS compression.
  398. This option was introduced in OpenSSL 1.1.0.
  399. TLS compression is not recommended and is off by default as of
  400. OpenSSL 1.1.0.
  401. =item B<-no_ticket>
  402. Disable RFC4507bis session ticket support. This option has no effect if TLSv1.3
  403. is negotiated. See B<-num_tickets>.
  404. =item B<-num_tickets>
  405. Control the number of tickets that will be sent to the client after a full
  406. handshake in TLSv1.3. The default number of tickets is 2. This option does not
  407. affect the number of tickets sent after a resumption handshake.
  408. =item B<-serverpref>
  409. Use the server's cipher preferences, rather than the client's preferences.
  410. =item B<-prioritize_chacha>
  411. Prioritize ChaCha ciphers when preferred by clients. Requires B<-serverpref>.
  412. =item B<-no_resumption_on_reneg>
  413. Set the B<SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION> option.
  414. =item B<-client_sigalgs> I<val>
  415. Signature algorithms to support for client certificate authentication
  416. (colon-separated list).
  417. =item B<-named_curve> I<val>
  418. Specifies the elliptic curve to use. NOTE: this is single curve, not a list.
  419. For a list of all possible curves, use:
  420. $ openssl ecparam -list_curves
  421. =item B<-cipher> I<val>
  422. This allows the list of TLSv1.2 and below ciphersuites used by the server to be
  423. modified. This list is combined with any TLSv1.3 ciphersuites that have been
  424. configured. When the client sends a list of supported ciphers the first client
  425. cipher also included in the server list is used. Because the client specifies
  426. the preference order, the order of the server cipherlist is irrelevant. See
  427. L<openssl-ciphers(1)> for more information.
  428. =item B<-ciphersuites> I<val>
  429. This allows the list of TLSv1.3 ciphersuites used by the server to be modified.
  430. This list is combined with any TLSv1.2 and below ciphersuites that have been
  431. configured. When the client sends a list of supported ciphers the first client
  432. cipher also included in the server list is used. Because the client specifies
  433. the preference order, the order of the server cipherlist is irrelevant. See
  434. L<openssl-ciphers(1)> command for more information. The format for this list is
  435. a simple colon (":") separated list of TLSv1.3 ciphersuite names.
  436. =item B<-dhparam> I<infile>
  437. The DH parameter file to use. The ephemeral DH cipher suites generate keys
  438. using a set of DH parameters. If not specified then an attempt is made to
  439. load the parameters from the server certificate file.
  440. If this fails then a static set of parameters hard coded into this command
  441. will be used.
  442. =item B<-nbio>
  443. Turns on non blocking I/O.
  444. =item B<-psk_identity> I<val>
  445. Expect the client to send PSK identity I<val> when using a PSK
  446. cipher suite, and warn if they do not. By default, the expected PSK
  447. identity is the string "Client_identity".
  448. =item B<-psk_hint> I<val>
  449. Use the PSK identity hint I<val> when using a PSK cipher suite.
  450. =item B<-psk> I<val>
  451. Use the PSK key I<val> when using a PSK cipher suite. The key is
  452. given as a hexadecimal number without leading 0x, for example -psk
  453. 1a2b3c4d.
  454. This option must be provided in order to use a PSK cipher.
  455. =item B<-psk_session> I<file>
  456. Use the pem encoded SSL_SESSION data stored in I<file> as the basis of a PSK.
  457. Note that this will only work if TLSv1.3 is negotiated.
  458. =item B<-listen>
  459. This option can only be used in conjunction with one of the DTLS options above.
  460. With this option, this command will listen on a UDP port for incoming
  461. connections.
  462. Any ClientHellos that arrive will be checked to see if they have a cookie in
  463. them or not.
  464. Any without a cookie will be responded to with a HelloVerifyRequest.
  465. If a ClientHello with a cookie is received then this command will
  466. connect to that peer and complete the handshake.
  467. =item B<-sctp>
  468. Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
  469. conjunction with B<-dtls>, B<-dtls1> or B<-dtls1_2>. This option is only
  470. available where OpenSSL has support for SCTP enabled.
  471. =item B<-sctp_label_bug>
  472. Use the incorrect behaviour of older OpenSSL implementations when computing
  473. endpoint-pair shared secrets for DTLS/SCTP. This allows communication with
  474. older broken implementations but breaks interoperability with correct
  475. implementations. Must be used in conjunction with B<-sctp>. This option is only
  476. available where OpenSSL has support for SCTP enabled.
  477. =item B<-no_dhe>
  478. If this option is set then no DH parameters will be loaded effectively
  479. disabling the ephemeral DH cipher suites.
  480. =item B<-alpn> I<val>, B<-nextprotoneg> I<val>
  481. These flags enable the Enable the Application-Layer Protocol Negotiation
  482. or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the
  483. IETF standard and replaces NPN.
  484. The I<val> list is a comma-separated list of supported protocol
  485. names. The list should contain the most desirable protocols first.
  486. Protocol names are printable ASCII strings, for example "http/1.1" or
  487. "spdy/3".
  488. The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
  489. =item B<-sendfile>
  490. If this option is set and KTLS is enabled, SSL_sendfile() will be used
  491. instead of BIO_write() to send the HTTP response requested by a client.
  492. This option is only valid if B<-WWW> or B<-HTTP> is specified.
  493. =item B<-keylogfile> I<outfile>
  494. Appends TLS secrets to the specified keylog file such that external programs
  495. (like Wireshark) can decrypt TLS connections.
  496. =item B<-max_early_data> I<int>
  497. Change the default maximum early data bytes that are specified for new sessions
  498. and any incoming early data (when used in conjunction with the B<-early_data>
  499. flag). The default value is approximately 16k. The argument must be an integer
  500. greater than or equal to 0.
  501. =item B<-recv_max_early_data> I<int>
  502. Specify the hard limit on the maximum number of early data bytes that will
  503. be accepted.
  504. =item B<-early_data>
  505. Accept early data where possible. Cannot be used in conjunction with B<-www>,
  506. B<-WWW>, B<-HTTP> or B<-rev>.
  507. =item B<-stateless>
  508. Require TLSv1.3 cookies.
  509. =item B<-anti_replay>, B<-no_anti_replay>
  510. Switches replay protection on or off, respectively. Replay protection is on by
  511. default unless overridden by a configuration file. When it is on, OpenSSL will
  512. automatically detect if a session ticket has been used more than once, TLSv1.3
  513. has been negotiated, and early data is enabled on the server. A full handshake
  514. is forced if a session ticket is used a second or subsequent time. Any early
  515. data that was sent will be rejected.
  516. {- $OpenSSL::safe::opt_name_item -}
  517. {- $OpenSSL::safe::opt_version_item -}
  518. {- $OpenSSL::safe::opt_s_item -}
  519. {- $OpenSSL::safe::opt_x_item -}
  520. {- $OpenSSL::safe::opt_trust_item -}
  521. {- $OpenSSL::safe::opt_r_item -}
  522. {- $OpenSSL::safe::opt_engine_item -}
  523. {- $OpenSSL::safe::opt_provider_item -}
  524. {- $OpenSSL::safe::opt_v_item -}
  525. If the server requests a client certificate, then
  526. verification errors are displayed, for debugging, but the command will
  527. proceed unless the B<-verify_return_error> option is used.
  528. =back
  529. =head1 CONNECTED COMMANDS
  530. If a connection request is established with an SSL client and neither the
  531. B<-www> nor the B<-WWW> option has been used then normally any data received
  532. from the client is displayed and any key presses will be sent to the client.
  533. Certain commands are also recognized which perform special operations. These
  534. commands are a letter which must appear at the start of a line. They are listed
  535. below.
  536. =over 4
  537. =item B<q>
  538. End the current SSL connection but still accept new connections.
  539. =item B<Q>
  540. End the current SSL connection and exit.
  541. =item B<r>
  542. Renegotiate the SSL session (TLSv1.2 and below only).
  543. =item B<R>
  544. Renegotiate the SSL session and request a client certificate (TLSv1.2 and below
  545. only).
  546. =item B<P>
  547. Send some plain text down the underlying TCP connection: this should
  548. cause the client to disconnect due to a protocol violation.
  549. =item B<S>
  550. Print out some session cache status information.
  551. =item B<k>
  552. Send a key update message to the client (TLSv1.3 only)
  553. =item B<K>
  554. Send a key update message to the client and request one back (TLSv1.3 only)
  555. =item B<c>
  556. Send a certificate request to the client (TLSv1.3 only)
  557. =back
  558. =head1 NOTES
  559. This command can be used to debug SSL clients. To accept connections
  560. from a web browser the command:
  561. openssl s_server -accept 443 -www
  562. can be used for example.
  563. Although specifying an empty list of CAs when requesting a client certificate
  564. is strictly speaking a protocol violation, some SSL clients interpret this to
  565. mean any CA is acceptable. This is useful for debugging purposes.
  566. The session parameters can printed out using the L<openssl-sess_id(1)> command.
  567. =head1 BUGS
  568. Because this program has a lot of options and also because some of the
  569. techniques used are rather old, the C source for this command is rather
  570. hard to read and not a model of how things should be done.
  571. A typical SSL server program would be much simpler.
  572. The output of common ciphers is wrong: it just gives the list of ciphers that
  573. OpenSSL recognizes and the client supports.
  574. There should be a way for this command to print out details
  575. of any unknown cipher suites a client says it supports.
  576. =head1 SEE ALSO
  577. L<openssl(1)>,
  578. L<openssl-sess_id(1)>,
  579. L<openssl-s_client(1)>,
  580. L<openssl-ciphers(1)>,
  581. L<SSL_CONF_cmd(3)>,
  582. L<SSL_CTX_set_max_send_fragment(3)>,
  583. L<SSL_CTX_set_split_send_fragment(3)>,
  584. L<SSL_CTX_set_max_pipelines(3)>,
  585. L<ossl_store-file(7)>
  586. =head1 HISTORY
  587. The -no_alt_chains option was added in OpenSSL 1.1.0.
  588. The
  589. -allow-no-dhe-kex and -prioritize_chacha options were added in OpenSSL 1.1.1.
  590. All B<-keyform> and B<-dkeyform> values except B<ENGINE>
  591. have become obsolete in OpenSSL 3.0.0 and have no effect.
  592. The B<-certform> and B<-dcertform> options have become obsolete in OpenSSL 3.0.0
  593. and have no effect.
  594. The B<-engine> option was deprecated in OpenSSL 3.0.
  595. =head1 COPYRIGHT
  596. Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
  597. Licensed under the Apache License 2.0 (the "License"). You may not use
  598. this file except in compliance with the License. You can obtain a copy
  599. in the file LICENSE in the source distribution or at
  600. L<https://www.openssl.org/source/license.html>.
  601. =cut