openssl-s_server.pod.in 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022
  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. For a list of all possible curves, use:
  481. $ openssl ecparam -list_curves
  482. =item B<-cipher> I<val>
  483. This allows the list of TLSv1.2 and below ciphersuites used by the server to be
  484. modified. This list is combined with any TLSv1.3 ciphersuites that have been
  485. configured. When the client sends a list of supported ciphers the first client
  486. cipher also included in the server list is used. Because the client specifies
  487. the preference order, the order of the server cipherlist is irrelevant. See
  488. L<openssl-ciphers(1)> for more information.
  489. =item B<-ciphersuites> I<val>
  490. This allows the list of TLSv1.3 ciphersuites used by the server to be modified.
  491. This list is combined with any TLSv1.2 and below ciphersuites that have been
  492. configured. When the client sends a list of supported ciphers the first client
  493. cipher also included in the server list is used. Because the client specifies
  494. the preference order, the order of the server cipherlist is irrelevant. See
  495. L<openssl-ciphers(1)> command for more information. The format for this list is
  496. a simple colon (":") separated list of TLSv1.3 ciphersuite names.
  497. =item B<-dhparam> I<infile>
  498. The DH parameter file to use. The ephemeral DH cipher suites generate keys
  499. using a set of DH parameters. If not specified then an attempt is made to
  500. load the parameters from the server certificate file.
  501. If this fails then a static set of parameters hard coded into this command
  502. will be used.
  503. =item B<-nbio>
  504. Turns on non blocking I/O.
  505. =item B<-timeout>
  506. Enable timeouts.
  507. =item B<-mtu>
  508. Set link-layer MTU.
  509. =item B<-psk_identity> I<val>
  510. Expect the client to send PSK identity I<val> when using a PSK
  511. cipher suite, and warn if they do not. By default, the expected PSK
  512. identity is the string "Client_identity".
  513. =item B<-psk_hint> I<val>
  514. Use the PSK identity hint I<val> when using a PSK cipher suite.
  515. =item B<-psk> I<val>
  516. Use the PSK key I<val> when using a PSK cipher suite. The key is
  517. given as a hexadecimal number without leading 0x, for example -psk
  518. 1a2b3c4d.
  519. This option must be provided in order to use a PSK cipher.
  520. =item B<-psk_session> I<file>
  521. Use the pem encoded SSL_SESSION data stored in I<file> as the basis of a PSK.
  522. Note that this will only work if TLSv1.3 is negotiated.
  523. =item B<-srpvfile>
  524. The verifier file for SRP.
  525. This option is deprecated.
  526. =item B<-srpuserseed>
  527. A seed string for a default user salt.
  528. This option is deprecated.
  529. =item B<-listen>
  530. This option can only be used in conjunction with one of the DTLS options above.
  531. With this option, this command will listen on a UDP port for incoming
  532. connections.
  533. Any ClientHellos that arrive will be checked to see if they have a cookie in
  534. them or not.
  535. Any without a cookie will be responded to with a HelloVerifyRequest.
  536. If a ClientHello with a cookie is received then this command will
  537. connect to that peer and complete the handshake.
  538. =item B<-sctp>
  539. Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
  540. conjunction with B<-dtls>, B<-dtls1> or B<-dtls1_2>. This option is only
  541. available where OpenSSL has support for SCTP enabled.
  542. =item B<-sctp_label_bug>
  543. Use the incorrect behaviour of older OpenSSL implementations when computing
  544. endpoint-pair shared secrets for DTLS/SCTP. This allows communication with
  545. older broken implementations but breaks interoperability with correct
  546. implementations. Must be used in conjunction with B<-sctp>. This option is only
  547. available where OpenSSL has support for SCTP enabled.
  548. =item B<-use_srtp>
  549. Offer SRTP key management with a colon-separated profile list.
  550. =item B<-no_dhe>
  551. If this option is set then no DH parameters will be loaded effectively
  552. disabling the ephemeral DH cipher suites.
  553. =item B<-alpn> I<val>, B<-nextprotoneg> I<val>
  554. These flags enable the Application-Layer Protocol Negotiation
  555. or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the
  556. IETF standard and replaces NPN.
  557. The I<val> list is a comma-separated list of supported protocol
  558. names. The list should contain the most desirable protocols first.
  559. Protocol names are printable ASCII strings, for example "http/1.1" or
  560. "spdy/3".
  561. The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
  562. =item B<-ktls>
  563. Enable Kernel TLS for sending and receiving.
  564. This option was introduced in OpenSSL 3.2.0.
  565. Kernel TLS is off by default as of OpenSSL 3.2.0.
  566. =item B<-sendfile>
  567. If this option is set and KTLS is enabled, SSL_sendfile() will be used
  568. instead of BIO_write() to send the HTTP response requested by a client.
  569. This option is only valid when B<-ktls> along with B<-WWW> or B<-HTTP>
  570. are specified.
  571. =item B<-zerocopy_sendfile>
  572. If this option is set, SSL_sendfile() will use the zerocopy TX mode, which gives
  573. a performance boost when used with KTLS hardware offload. Note that invalid
  574. TLS records might be transmitted if the file is changed while being sent.
  575. This option depends on B<-sendfile>; when used alone, B<-sendfile> is implied,
  576. and a warning is shown. Note that KTLS sendfile on FreeBSD always runs in the
  577. zerocopy mode.
  578. =item B<-keylogfile> I<outfile>
  579. Appends TLS secrets to the specified keylog file such that external programs
  580. (like Wireshark) can decrypt TLS connections.
  581. =item B<-max_early_data> I<int>
  582. Change the default maximum early data bytes that are specified for new sessions
  583. and any incoming early data (when used in conjunction with the B<-early_data>
  584. flag). The default value is approximately 16k. The argument must be an integer
  585. greater than or equal to 0.
  586. =item B<-recv_max_early_data> I<int>
  587. Specify the hard limit on the maximum number of early data bytes that will
  588. be accepted.
  589. =item B<-early_data>
  590. Accept early data where possible. Cannot be used in conjunction with B<-www>,
  591. B<-WWW>, B<-HTTP> or B<-rev>.
  592. =item B<-stateless>
  593. Require TLSv1.3 cookies.
  594. =item B<-anti_replay>, B<-no_anti_replay>
  595. Switches replay protection on or off, respectively. Replay protection is on by
  596. default unless overridden by a configuration file. When it is on, OpenSSL will
  597. automatically detect if a session ticket has been used more than once, TLSv1.3
  598. has been negotiated, and early data is enabled on the server. A full handshake
  599. is forced if a session ticket is used a second or subsequent time. Any early
  600. data that was sent will be rejected.
  601. =item B<-tfo>
  602. Enable acceptance of TCP Fast Open (RFC7413) connections.
  603. =item B<-cert_comp>
  604. Pre-compresses certificates (RFC8879) that will be sent during the handshake.
  605. {- $OpenSSL::safe::opt_name_item -}
  606. {- $OpenSSL::safe::opt_version_item -}
  607. {- $OpenSSL::safe::opt_s_item -}
  608. {- $OpenSSL::safe::opt_x_item -}
  609. {- $OpenSSL::safe::opt_trust_item -}
  610. {- $OpenSSL::safe::opt_r_item -}
  611. {- $OpenSSL::safe::opt_engine_item -}
  612. {- $OpenSSL::safe::opt_provider_item -}
  613. {- $OpenSSL::safe::opt_v_item -}
  614. If the server requests a client certificate, then
  615. verification errors are displayed, for debugging, but the command will
  616. proceed unless the B<-verify_return_error> option is used.
  617. =item B<-enable_server_rpk>
  618. Enable support for sending raw public keys (RFC7250) to the client.
  619. A raw public key will be sent by the server, if solicited by the client,
  620. provided a suitable key and public certificate pair is configured.
  621. Clients that don't support raw public keys or prefer to use X.509
  622. certificates can still elect to receive X.509 certificates as usual.
  623. Raw public keys are extracted from the configured certificate/private key.
  624. =item B<-enable_client_rpk>
  625. Enable support for receiving raw public keys (RFC7250) from the client.
  626. Use of X.509 certificates by the client becomes optional, and clients that
  627. support raw public keys may elect to use them.
  628. Clients that don't support raw public keys or prefer to use X.509
  629. certificates can still elect to send X.509 certificates as usual.
  630. Raw public keys are extracted from the configured certificate/private key.
  631. =back
  632. =head1 CONNECTED COMMANDS
  633. If a connection request is established with an SSL client and neither the
  634. B<-www> nor the B<-WWW> option has been used then normally any data received
  635. from the client is displayed and any key presses will be sent to the client.
  636. Certain commands are also recognized which perform special operations. These
  637. commands are a letter which must appear at the start of a line. They are listed
  638. below.
  639. =over 4
  640. =item B<q>
  641. End the current SSL connection but still accept new connections.
  642. =item B<Q>
  643. End the current SSL connection and exit.
  644. =item B<r>
  645. Renegotiate the SSL session (TLSv1.2 and below only).
  646. =item B<R>
  647. Renegotiate the SSL session and request a client certificate (TLSv1.2 and below
  648. only).
  649. =item B<P>
  650. Send some plain text down the underlying TCP connection: this should
  651. cause the client to disconnect due to a protocol violation.
  652. =item B<S>
  653. Print out some session cache status information.
  654. =item B<k>
  655. Send a key update message to the client (TLSv1.3 only)
  656. =item B<K>
  657. Send a key update message to the client and request one back (TLSv1.3 only)
  658. =item B<c>
  659. Send a certificate request to the client (TLSv1.3 only)
  660. =back
  661. =head1 NOTES
  662. This command can be used to debug SSL clients. To accept connections
  663. from a web browser the command:
  664. openssl s_server -accept 443 -www
  665. can be used for example.
  666. Although specifying an empty list of CAs when requesting a client certificate
  667. is strictly speaking a protocol violation, some SSL clients interpret this to
  668. mean any CA is acceptable. This is useful for debugging purposes.
  669. The session parameters can printed out using the L<openssl-sess_id(1)> command.
  670. =head1 BUGS
  671. Because this program has a lot of options and also because some of the
  672. techniques used are rather old, the C source for this command is rather
  673. hard to read and not a model of how things should be done.
  674. A typical SSL server program would be much simpler.
  675. The output of common ciphers is wrong: it just gives the list of ciphers that
  676. OpenSSL recognizes and the client supports.
  677. There should be a way for this command to print out details
  678. of any unknown cipher suites a client says it supports.
  679. =head1 SEE ALSO
  680. L<openssl(1)>,
  681. L<openssl-sess_id(1)>,
  682. L<openssl-s_client(1)>,
  683. L<openssl-ciphers(1)>,
  684. L<SSL_CONF_cmd(3)>,
  685. L<SSL_CTX_set_max_send_fragment(3)>,
  686. L<SSL_CTX_set_split_send_fragment(3)>,
  687. L<SSL_CTX_set_max_pipelines(3)>,
  688. L<ossl_store-file(7)>
  689. =head1 HISTORY
  690. The -no_alt_chains option was added in OpenSSL 1.1.0.
  691. The
  692. -allow-no-dhe-kex and -prioritize_chacha options were added in OpenSSL 1.1.1.
  693. The B<-srpvfile>, B<-srpuserseed>, and B<-engine>
  694. option were deprecated in OpenSSL 3.0.
  695. The
  696. B<-enable_client_rpk>,
  697. B<-enable_server_rpk>,
  698. B<-no_rx_cert_comp>,
  699. B<-no_tx_cert_comp>,
  700. and B<-tfo>
  701. options were added in OpenSSL 3.2.
  702. =head1 COPYRIGHT
  703. Copyright 2000-2024 The OpenSSL Project Authors. All Rights Reserved.
  704. Licensed under the Apache License 2.0 (the "License"). You may not use
  705. this file except in compliance with the License. You can obtain a copy
  706. in the file LICENSE in the source distribution or at
  707. L<https://www.openssl.org/source/license.html>.
  708. =cut