openssl-s_server.pod.in 30 KB

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