openssl-s_server.pod.in 27 KB

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