openssl-s_client.pod.in 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956
  1. =pod
  2. {- OpenSSL::safe::output_do_not_edit_headers(); -}
  3. =head1 NAME
  4. openssl-s_client - SSL/TLS client program
  5. =head1 SYNOPSIS
  6. B<openssl> B<s_client>
  7. [B<-help>]
  8. [B<-ssl_config> I<section>]
  9. [B<-connect> I<host:port>]
  10. [B<-host> I<hostname>]
  11. [B<-port> I<port>]
  12. [B<-bind> I<host:port>]
  13. [B<-proxy> I<host:port>]
  14. [B<-proxy_user> I<userid>]
  15. [B<-proxy_pass> I<arg>]
  16. [B<-unix> I<path>]
  17. [B<-4>]
  18. [B<-6>]
  19. [B<-servername> I<name>]
  20. [B<-noservername>]
  21. [B<-verify> I<depth>]
  22. [B<-verify_return_error>]
  23. [B<-verify_quiet>]
  24. [B<-verifyCAfile> I<filename>]
  25. [B<-verifyCApath> I<dir>]
  26. [B<-verifyCAstore> I<uri>]
  27. [B<-cert> I<filename>]
  28. [B<-certform> B<DER>|B<PEM>|B<P12>]
  29. [B<-cert_chain> I<filename>]
  30. [B<-build_chain>]
  31. [B<-CRL> I<filename>]
  32. [B<-CRLform> B<DER>|B<PEM>]
  33. [B<-crl_download>]
  34. [B<-key> I<filename>|I<uri>]
  35. [B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
  36. [B<-pass> I<arg>]
  37. [B<-chainCAfile> I<filename>]
  38. [B<-chainCApath> I<directory>]
  39. [B<-chainCAstore> I<uri>]
  40. [B<-requestCAfile> I<filename>]
  41. [B<-dane_tlsa_domain> I<domain>]
  42. [B<-dane_tlsa_rrdata> I<rrdata>]
  43. [B<-dane_ee_no_namechecks>]
  44. [B<-reconnect>]
  45. [B<-showcerts>]
  46. [B<-prexit>]
  47. [B<-no-interactive>]
  48. [B<-debug>]
  49. [B<-trace>]
  50. [B<-nocommands>]
  51. [B<-security_debug>]
  52. [B<-security_debug_verbose>]
  53. [B<-msg>]
  54. [B<-timeout>]
  55. [B<-mtu> I<size>]
  56. [B<-no_etm>]
  57. [B<-no_ems>]
  58. [B<-keymatexport> I<label>]
  59. [B<-keymatexportlen> I<len>]
  60. [B<-msgfile> I<filename>]
  61. [B<-nbio_test>]
  62. [B<-state>]
  63. [B<-nbio>]
  64. [B<-crlf>]
  65. [B<-ign_eof>]
  66. [B<-no_ign_eof>]
  67. [B<-psk_identity> I<identity>]
  68. [B<-psk> I<key>]
  69. [B<-psk_session> I<file>]
  70. [B<-quiet>]
  71. [B<-sctp>]
  72. [B<-sctp_label_bug>]
  73. [B<-fallback_scsv>]
  74. [B<-async>]
  75. [B<-maxfraglen> I<len>]
  76. [B<-max_send_frag>]
  77. [B<-split_send_frag>]
  78. [B<-max_pipelines>]
  79. [B<-read_buf>]
  80. [B<-ignore_unexpected_eof>]
  81. [B<-bugs>]
  82. [B<-no_tx_cert_comp>]
  83. [B<-no_rx_cert_comp>]
  84. [B<-comp>]
  85. [B<-no_comp>]
  86. [B<-brief>]
  87. [B<-legacy_server_connect>]
  88. [B<-no_legacy_server_connect>]
  89. [B<-allow_no_dhe_kex>]
  90. [B<-sigalgs> I<sigalglist>]
  91. [B<-curves> I<curvelist>]
  92. [B<-cipher> I<cipherlist>]
  93. [B<-ciphersuites> I<val>]
  94. [B<-serverpref>]
  95. [B<-starttls> I<protocol>]
  96. [B<-name> I<hostname>]
  97. [B<-xmpphost> I<hostname>]
  98. [B<-name> I<hostname>]
  99. [B<-tlsextdebug>]
  100. [B<-no_ticket>]
  101. [B<-sess_out> I<filename>]
  102. [B<-serverinfo> I<types>]
  103. [B<-sess_in> I<filename>]
  104. [B<-serverinfo> I<types>]
  105. [B<-status>]
  106. [B<-alpn> I<protocols>]
  107. [B<-nextprotoneg> I<protocols>]
  108. [B<-ct>]
  109. [B<-noct>]
  110. [B<-ctlogfile>]
  111. [B<-keylogfile> I<file>]
  112. [B<-early_data> I<file>]
  113. [B<-enable_pha>]
  114. [B<-use_srtp> I<value>]
  115. [B<-srpuser> I<value>]
  116. [B<-srppass> I<value>]
  117. [B<-srp_lateuser>]
  118. [B<-srp_moregroups>]
  119. [B<-srp_strength> I<number>]
  120. [B<-ktls>]
  121. [B<-tfo>]
  122. {- $OpenSSL::safe::opt_name_synopsis -}
  123. {- $OpenSSL::safe::opt_version_synopsis -}
  124. {- $OpenSSL::safe::opt_x_synopsis -}
  125. {- $OpenSSL::safe::opt_trust_synopsis -}
  126. {- $OpenSSL::safe::opt_s_synopsis -}
  127. {- $OpenSSL::safe::opt_r_synopsis -}
  128. {- $OpenSSL::safe::opt_provider_synopsis -}
  129. {- $OpenSSL::safe::opt_engine_synopsis -}[B<-ssl_client_engine> I<id>]
  130. {- $OpenSSL::safe::opt_v_synopsis -}
  131. [I<host>:I<port>]
  132. =head1 DESCRIPTION
  133. This command implements a generic SSL/TLS client which
  134. connects to a remote host using SSL/TLS. It is a I<very> useful diagnostic
  135. tool for SSL servers.
  136. =head1 OPTIONS
  137. In addition to the options below, this command also supports the
  138. common and client only options documented
  139. in the "Supported Command Line Commands" section of the L<SSL_CONF_cmd(3)>
  140. manual page.
  141. =over 4
  142. =item B<-help>
  143. Print out a usage message.
  144. =item B<-ssl_config> I<section>
  145. Use the specified section of the configuration file to configure the B<SSL_CTX> object.
  146. =item B<-connect> I<host>:I<port>
  147. This specifies the host and optional port to connect to. It is possible to
  148. select the host and port using the optional target positional argument instead.
  149. If neither this nor the target positional argument are specified then an attempt
  150. is made to connect to the local host on port 4433.
  151. =item B<-host> I<hostname>
  152. Host to connect to; use B<-connect> instead.
  153. =item B<-port> I<port>
  154. Connect to the specified port; use B<-connect> instead.
  155. =item B<-bind> I<host:port>
  156. This specifies the host address and or port to bind as the source for the
  157. connection. For Unix-domain sockets the port is ignored and the host is
  158. used as the source socket address.
  159. =item B<-proxy> I<host:port>
  160. When used with the B<-connect> flag, the program uses the host and port
  161. specified with this flag and issues an HTTP CONNECT command to connect
  162. to the desired server.
  163. =item B<-proxy_user> I<userid>
  164. When used with the B<-proxy> flag, the program will attempt to authenticate
  165. with the specified proxy using basic (base64) authentication.
  166. NB: Basic authentication is insecure; the credentials are sent to the proxy
  167. in easily reversible base64 encoding before any TLS/SSL session is established.
  168. Therefore, these credentials are easily recovered by anyone able to sniff/trace
  169. the network. Use with caution.
  170. =item B<-proxy_pass> I<arg>
  171. The proxy password source, used with the B<-proxy_user> flag.
  172. For more information about the format of B<arg>
  173. see L<openssl-passphrase-options(1)>.
  174. =item B<-unix> I<path>
  175. Connect over the specified Unix-domain socket.
  176. =item B<-4>
  177. Use IPv4 only.
  178. =item B<-6>
  179. Use IPv6 only.
  180. =item B<-servername> I<name>
  181. Set the TLS SNI (Server Name Indication) extension in the ClientHello message to
  182. the given value.
  183. If B<-servername> is not provided, the TLS SNI extension will be populated with
  184. the name given to B<-connect> if it follows a DNS name format. If B<-connect> is
  185. not provided either, the SNI is set to "localhost".
  186. This is the default since OpenSSL 1.1.1.
  187. Even though SNI should normally be a DNS name and not an IP address, if
  188. B<-servername> is provided then that name will be sent, regardless of whether
  189. it is a DNS name or not.
  190. This option cannot be used in conjunction with B<-noservername>.
  191. =item B<-noservername>
  192. Suppresses sending of the SNI (Server Name Indication) extension in the
  193. ClientHello message. Cannot be used in conjunction with the B<-servername> or
  194. B<-dane_tlsa_domain> options.
  195. =item B<-cert> I<filename>
  196. The client certificate to use, if one is requested by the server.
  197. The default is not to use a certificate.
  198. The chain for the client certificate may be specified using B<-cert_chain>.
  199. =item B<-certform> B<DER>|B<PEM>|B<P12>
  200. The client certificate file format to use; unspecified by default.
  201. See L<openssl-format-options(1)> for details.
  202. =item B<-cert_chain>
  203. A file or URI of untrusted certificates to use when attempting to build the
  204. certificate chain related to the certificate specified via the B<-cert> option.
  205. The input can be in PEM, DER, or PKCS#12 format.
  206. =item B<-build_chain>
  207. Specify whether the application should build the client certificate chain to be
  208. provided to the server.
  209. =item B<-CRL> I<filename>
  210. CRL file to use to check the server's certificate.
  211. =item B<-CRLform> B<DER>|B<PEM>
  212. The CRL file format; unspecified by default.
  213. See L<openssl-format-options(1)> for details.
  214. =item B<-crl_download>
  215. Download CRL from distribution points in the certificate.
  216. =item B<-key> I<filename>|I<uri>
  217. The client private key to use.
  218. If not specified then the certificate file will be used to read also the key.
  219. =item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
  220. The key format; unspecified by default.
  221. See L<openssl-format-options(1)> for details.
  222. =item B<-pass> I<arg>
  223. the private key and certificate file password source.
  224. For more information about the format of I<arg>
  225. see L<openssl-passphrase-options(1)>.
  226. =item B<-verify> I<depth>
  227. The verify depth to use. This specifies the maximum length of the
  228. server certificate chain and turns on server certificate verification.
  229. Currently the verify operation continues after errors so all the problems
  230. with a certificate chain can be seen. As a side effect the connection
  231. will never fail due to a server certificate verify failure.
  232. =item B<-verify_return_error>
  233. Return verification errors instead of continuing. This will typically
  234. abort the handshake with a fatal error.
  235. =item B<-verify_quiet>
  236. Limit verify output to only errors.
  237. =item B<-verifyCAfile> I<filename>
  238. A file in PEM format containing trusted certificates to use
  239. for verifying the server's certificate.
  240. =item B<-verifyCApath> I<dir>
  241. A directory containing trusted certificates to use
  242. for verifying the server's certificate.
  243. This directory must be in "hash format",
  244. see L<openssl-verify(1)> for more information.
  245. =item B<-verifyCAstore> I<uri>
  246. The URI of a store containing trusted certificates to use
  247. for verifying the server's certificate.
  248. =item B<-chainCAfile> I<file>
  249. A file in PEM format containing trusted certificates to use
  250. when attempting to build the client certificate chain.
  251. =item B<-chainCApath> I<directory>
  252. A directory containing trusted certificates to use
  253. for building the client certificate chain provided to the server.
  254. This directory must be in "hash format",
  255. see L<openssl-verify(1)> for more information.
  256. =item B<-chainCAstore> I<uri>
  257. The URI of a store containing trusted certificates to use
  258. when attempting to build the client certificate chain.
  259. The URI may indicate a single certificate, as well as a collection of them.
  260. With URIs in the C<file:> scheme, this acts as B<-chainCAfile> or
  261. B<-chainCApath>, depending on if the URI indicates a directory or a
  262. single file.
  263. See L<ossl_store-file(7)> for more information on the C<file:> scheme.
  264. =item B<-requestCAfile> I<file>
  265. A file containing a list of certificates whose subject names will be sent
  266. to the server in the B<certificate_authorities> extension. Only supported
  267. for TLS 1.3
  268. =item B<-dane_tlsa_domain> I<domain>
  269. Enable RFC6698/RFC7671 DANE TLSA authentication and specify the
  270. TLSA base domain which becomes the default SNI hint and the primary
  271. reference identifier for hostname checks. This must be used in
  272. combination with at least one instance of the B<-dane_tlsa_rrdata>
  273. option below.
  274. When DANE authentication succeeds, the diagnostic output will include
  275. the lowest (closest to 0) depth at which a TLSA record authenticated
  276. a chain certificate. When that TLSA record is a "2 1 0" trust
  277. anchor public key that signed (rather than matched) the top-most
  278. certificate of the chain, the result is reported as "TA public key
  279. verified". Otherwise, either the TLSA record "matched TA certificate"
  280. at a positive depth or else "matched EE certificate" at depth 0.
  281. =item B<-dane_tlsa_rrdata> I<rrdata>
  282. Use one or more times to specify the RRDATA fields of the DANE TLSA
  283. RRset associated with the target service. The I<rrdata> value is
  284. specified in "presentation form", that is four whitespace separated
  285. fields that specify the usage, selector, matching type and associated
  286. data, with the last of these encoded in hexadecimal. Optional
  287. whitespace is ignored in the associated data field. For example:
  288. $ openssl s_client -brief -starttls smtp \
  289. -connect smtp.example.com:25 \
  290. -dane_tlsa_domain smtp.example.com \
  291. -dane_tlsa_rrdata "2 1 1
  292. B111DD8A1C2091A89BD4FD60C57F0716CCE50FEEFF8137CDBEE0326E 02CF362B" \
  293. -dane_tlsa_rrdata "2 1 1
  294. 60B87575447DCBA2A36B7D11AC09FB24A9DB406FEE12D2CC90180517 616E8A18"
  295. ...
  296. Verification: OK
  297. Verified peername: smtp.example.com
  298. DANE TLSA 2 1 1 ...ee12d2cc90180517616e8a18 matched TA certificate at depth 1
  299. ...
  300. =item B<-dane_ee_no_namechecks>
  301. This disables server name checks when authenticating via DANE-EE(3) TLSA
  302. records.
  303. For some applications, primarily web browsers, it is not safe to disable name
  304. checks due to "unknown key share" attacks, in which a malicious server can
  305. convince a client that a connection to a victim server is instead a secure
  306. connection to the malicious server.
  307. The malicious server may then be able to violate cross-origin scripting
  308. restrictions.
  309. Thus, despite the text of RFC7671, name checks are by default enabled for
  310. DANE-EE(3) TLSA records, and can be disabled in applications where it is safe
  311. to do so.
  312. In particular, SMTP and XMPP clients should set this option as SRV and MX
  313. records already make it possible for a remote domain to redirect client
  314. connections to any server of its choice, and in any case SMTP and XMPP clients
  315. do not execute scripts downloaded from remote servers.
  316. =item B<-reconnect>
  317. Reconnects to the same server 5 times using the same session ID, this can
  318. be used as a test that session caching is working.
  319. =item B<-showcerts>
  320. Displays the server certificate list as sent by the server: it only consists of
  321. certificates the server has sent (in the order the server has sent them). It is
  322. B<not> a verified chain.
  323. =item B<-prexit>
  324. Print session information when the program exits. This will always attempt
  325. to print out information even if the connection fails. Normally information
  326. will only be printed out once if the connection succeeds. This option is useful
  327. because the cipher in use may be renegotiated or the connection may fail
  328. because a client certificate is required or is requested only after an
  329. attempt is made to access a certain URL. Note: the output produced by this
  330. option is not always accurate because a connection might never have been
  331. established.
  332. =item B<-no-interactive>
  333. This flag can be used to run the client in a non-interactive mode.
  334. =item B<-state>
  335. Prints out the SSL session states.
  336. =item B<-debug>
  337. Print extensive debugging information including a hex dump of all traffic.
  338. =item B<-nocommands>
  339. Do not use interactive command letters.
  340. =item B<-security_debug>
  341. Enable security debug messages.
  342. =item B<-security_debug_verbose>
  343. Output more security debug output.
  344. =item B<-msg>
  345. Show protocol messages.
  346. =item B<-timeout>
  347. Enable send/receive timeout on DTLS connections.
  348. =item B<-mtu> I<size>
  349. Set MTU of the link layer to the specified size.
  350. =item B<-no_etm>
  351. Disable Encrypt-then-MAC negotiation.
  352. =item B<-no_ems>
  353. Disable Extended master secret negotiation.
  354. =item B<-keymatexport> I<label>
  355. Export keying material using the specified label.
  356. =item B<-keymatexportlen> I<len>
  357. Export the specified number of bytes of keying material; default is 20.
  358. Show all protocol messages with hex dump.
  359. =item B<-trace>
  360. Show verbose trace output of protocol messages.
  361. =item B<-msgfile> I<filename>
  362. File to send output of B<-msg> or B<-trace> to, default standard output.
  363. =item B<-nbio_test>
  364. Tests nonblocking I/O
  365. =item B<-nbio>
  366. Turns on nonblocking I/O
  367. =item B<-crlf>
  368. This option translated a line feed from the terminal into CR+LF as required
  369. by some servers.
  370. =item B<-ign_eof>
  371. Inhibit shutting down the connection when end of file is reached in the
  372. input.
  373. =item B<-quiet>
  374. Inhibit printing of session and certificate information. This implicitly
  375. turns on B<-ign_eof> as well.
  376. =item B<-no_ign_eof>
  377. Shut down the connection when end of file is reached in the input.
  378. Can be used to override the implicit B<-ign_eof> after B<-quiet>.
  379. =item B<-psk_identity> I<identity>
  380. Use the PSK identity I<identity> when using a PSK cipher suite.
  381. The default value is "Client_identity" (without the quotes).
  382. =item B<-psk> I<key>
  383. Use the PSK key I<key> when using a PSK cipher suite. The key is
  384. given as a hexadecimal number without leading 0x, for example -psk
  385. 1a2b3c4d.
  386. This option must be provided in order to use a PSK cipher.
  387. =item B<-psk_session> I<file>
  388. Use the pem encoded SSL_SESSION data stored in I<file> as the basis of a PSK.
  389. Note that this will only work if TLSv1.3 is negotiated.
  390. =item B<-sctp>
  391. Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
  392. conjunction with B<-dtls>, B<-dtls1> or B<-dtls1_2>. This option is only
  393. available where OpenSSL has support for SCTP enabled.
  394. =item B<-sctp_label_bug>
  395. Use the incorrect behaviour of older OpenSSL implementations when computing
  396. endpoint-pair shared secrets for DTLS/SCTP. This allows communication with
  397. older broken implementations but breaks interoperability with correct
  398. implementations. Must be used in conjunction with B<-sctp>. This option is only
  399. available where OpenSSL has support for SCTP enabled.
  400. =item B<-fallback_scsv>
  401. Send TLS_FALLBACK_SCSV in the ClientHello.
  402. =item B<-async>
  403. Switch on asynchronous mode. Cryptographic operations will be performed
  404. asynchronously. This will only have an effect if an asynchronous capable engine
  405. is also used via the B<-engine> option. For test purposes the dummy async engine
  406. (dasync) can be used (if available).
  407. =item B<-maxfraglen> I<len>
  408. Enable Maximum Fragment Length Negotiation; allowed values are
  409. C<512>, C<1024>, C<2048>, and C<4096>.
  410. =item B<-max_send_frag> I<int>
  411. The maximum size of data fragment to send.
  412. See L<SSL_CTX_set_max_send_fragment(3)> for further information.
  413. =item B<-split_send_frag> I<int>
  414. The size used to split data for encrypt pipelines. If more data is written in
  415. one go than this value then it will be split into multiple pipelines, up to the
  416. maximum number of pipelines defined by max_pipelines. This only has an effect if
  417. a suitable cipher suite has been negotiated, an engine that supports pipelining
  418. has been loaded, and max_pipelines is greater than 1. See
  419. L<SSL_CTX_set_split_send_fragment(3)> for further information.
  420. =item B<-max_pipelines> I<int>
  421. The maximum number of encrypt/decrypt pipelines to be used. This will only have
  422. an effect if an engine has been loaded that supports pipelining (e.g. the dasync
  423. engine) and a suitable cipher suite has been negotiated. The default value is 1.
  424. See L<SSL_CTX_set_max_pipelines(3)> for further information.
  425. =item B<-read_buf> I<int>
  426. The default read buffer size to be used for connections. This will only have an
  427. effect if the buffer size is larger than the size that would otherwise be used
  428. and pipelining is in use (see L<SSL_CTX_set_default_read_buffer_len(3)> for
  429. further information).
  430. =item B<-ignore_unexpected_eof>
  431. Some TLS implementations do not send the mandatory close_notify alert on
  432. shutdown. If the application tries to wait for the close_notify alert but the
  433. peer closes the connection without sending it, an error is generated. When this
  434. option is enabled the peer does not need to send the close_notify alert and a
  435. closed connection will be treated as if the close_notify alert was received.
  436. For more information on shutting down a connection, see L<SSL_shutdown(3)>.
  437. =item B<-bugs>
  438. There are several known bugs in SSL and TLS implementations. Adding this
  439. option enables various workarounds.
  440. =item B<-no_tx_cert_comp>
  441. Disables support for sending TLSv1.3 compressed certificates.
  442. =item B<-no_rx_cert_comp>
  443. Disables support for receiving TLSv1.3 compressed certificate.
  444. =item B<-comp>
  445. Enables support for SSL/TLS compression.
  446. This option was introduced in OpenSSL 1.1.0.
  447. TLS compression is not recommended and is off by default as of
  448. OpenSSL 1.1.0.
  449. =item B<-no_comp>
  450. Disables support for SSL/TLS compression.
  451. TLS compression is not recommended and is off by default as of
  452. OpenSSL 1.1.0.
  453. =item B<-brief>
  454. Only provide a brief summary of connection parameters instead of the
  455. normal verbose output.
  456. =item B<-sigalgs> I<sigalglist>
  457. Specifies the list of signature algorithms that are sent by the client.
  458. The server selects one entry in the list based on its preferences.
  459. For example strings, see L<SSL_CTX_set1_sigalgs(3)>
  460. =item B<-curves> I<curvelist>
  461. Specifies the list of supported curves to be sent by the client. The curve is
  462. ultimately selected by the server. For a list of all curves, use:
  463. $ openssl ecparam -list_curves
  464. =item B<-cipher> I<cipherlist>
  465. This allows the TLSv1.2 and below cipher list sent by the client to be modified.
  466. This list will be combined with any TLSv1.3 ciphersuites that have been
  467. configured. Although the server determines which ciphersuite is used it should
  468. take the first supported cipher in the list sent by the client. See
  469. L<openssl-ciphers(1)> for more information.
  470. =item B<-ciphersuites> I<val>
  471. This allows the TLSv1.3 ciphersuites sent by the client to be modified. This
  472. list will be combined with any TLSv1.2 and below ciphersuites that have been
  473. configured. Although the server determines which cipher suite is used it should
  474. take the first supported cipher in the list sent by the client. See
  475. L<openssl-ciphers(1)> for more information. The format for this list is a simple
  476. colon (":") separated list of TLSv1.3 ciphersuite names.
  477. =item B<-starttls> I<protocol>
  478. Send the protocol-specific message(s) to switch to TLS for communication.
  479. I<protocol> is a keyword for the intended protocol. Currently, the only
  480. supported keywords are "smtp", "pop3", "imap", "ftp", "xmpp", "xmpp-server",
  481. "irc", "postgres", "mysql", "lmtp", "nntp", "sieve" and "ldap".
  482. =item B<-xmpphost> I<hostname>
  483. This option, when used with "-starttls xmpp" or "-starttls xmpp-server",
  484. specifies the host for the "to" attribute of the stream element.
  485. If this option is not specified, then the host specified with "-connect"
  486. will be used.
  487. This option is an alias of the B<-name> option for "xmpp" and "xmpp-server".
  488. =item B<-name> I<hostname>
  489. This option is used to specify hostname information for various protocols
  490. used with B<-starttls> option. Currently only "xmpp", "xmpp-server",
  491. "smtp" and "lmtp" can utilize this B<-name> option.
  492. If this option is used with "-starttls xmpp" or "-starttls xmpp-server",
  493. if specifies the host for the "to" attribute of the stream element. If this
  494. option is not specified, then the host specified with "-connect" will be used.
  495. If this option is used with "-starttls lmtp" or "-starttls smtp", it specifies
  496. the name to use in the "LMTP LHLO" or "SMTP EHLO" message, respectively. If
  497. this option is not specified, then "mail.example.com" will be used.
  498. =item B<-tlsextdebug>
  499. Print out a hex dump of any TLS extensions received from the server.
  500. =item B<-no_ticket>
  501. Disable RFC4507bis session ticket support.
  502. =item B<-sess_out> I<filename>
  503. Output SSL session to I<filename>.
  504. =item B<-sess_in> I<filename>
  505. Load SSL session from I<filename>. The client will attempt to resume a
  506. connection from this session.
  507. =item B<-serverinfo> I<types>
  508. A list of comma-separated TLS Extension Types (numbers between 0 and
  509. 65535). Each type will be sent as an empty ClientHello TLS Extension.
  510. The server's response (if any) will be encoded and displayed as a PEM
  511. file.
  512. =item B<-status>
  513. Sends a certificate status request to the server (OCSP stapling). The server
  514. response (if any) is printed out.
  515. =item B<-alpn> I<protocols>, B<-nextprotoneg> I<protocols>
  516. These flags enable the Enable the Application-Layer Protocol Negotiation
  517. or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the
  518. IETF standard and replaces NPN.
  519. The I<protocols> list is a comma-separated list of protocol names that
  520. the client should advertise support for. The list should contain the most
  521. desirable protocols first. Protocol names are printable ASCII strings,
  522. for example "http/1.1" or "spdy/3".
  523. An empty list of protocols is treated specially and will cause the
  524. client to advertise support for the TLS extension but disconnect just
  525. after receiving ServerHello with a list of server supported protocols.
  526. The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
  527. =item B<-ct>, B<-noct>
  528. Use one of these two options to control whether Certificate Transparency (CT)
  529. is enabled (B<-ct>) or disabled (B<-noct>).
  530. If CT is enabled, signed certificate timestamps (SCTs) will be requested from
  531. the server and reported at handshake completion.
  532. Enabling CT also enables OCSP stapling, as this is one possible delivery method
  533. for SCTs.
  534. =item B<-ctlogfile>
  535. A file containing a list of known Certificate Transparency logs. See
  536. L<SSL_CTX_set_ctlog_list_file(3)> for the expected file format.
  537. =item B<-keylogfile> I<file>
  538. Appends TLS secrets to the specified keylog file such that external programs
  539. (like Wireshark) can decrypt TLS connections.
  540. =item B<-early_data> I<file>
  541. Reads the contents of the specified file and attempts to send it as early data
  542. to the server. This will only work with resumed sessions that support early
  543. data and when the server accepts the early data.
  544. =item B<-enable_pha>
  545. For TLSv1.3 only, send the Post-Handshake Authentication extension. This will
  546. happen whether or not a certificate has been provided via B<-cert>.
  547. =item B<-use_srtp> I<value>
  548. Offer SRTP key management, where B<value> is a colon-separated profile list.
  549. =item B<-srpuser> I<value>
  550. Set the SRP username to the specified value. This option is deprecated.
  551. =item B<-srppass> I<value>
  552. Set the SRP password to the specified value. This option is deprecated.
  553. =item B<-srp_lateuser>
  554. SRP username for the second ClientHello message. This option is deprecated.
  555. =item B<-srp_moregroups> This option is deprecated.
  556. Tolerate other than the known B<g> and B<N> values.
  557. =item B<-srp_strength> I<number>
  558. Set the minimal acceptable length, in bits, for B<N>. This option is
  559. deprecated.
  560. =item B<-ktls>
  561. Enable Kernel TLS for sending and receiving.
  562. This option was introduced in OpenSSL 3.2.0.
  563. Kernel TLS is off by default as of OpenSSL 3.2.0.
  564. =item B<-tfo>
  565. Enable creation of connections via TCP fast open (RFC7413).
  566. {- $OpenSSL::safe::opt_version_item -}
  567. {- $OpenSSL::safe::opt_name_item -}
  568. {- $OpenSSL::safe::opt_x_item -}
  569. {- $OpenSSL::safe::opt_trust_item -}
  570. {- $OpenSSL::safe::opt_s_item -}
  571. {- $OpenSSL::safe::opt_r_item -}
  572. {- $OpenSSL::safe::opt_provider_item -}
  573. {- $OpenSSL::safe::opt_engine_item -}
  574. {- output_off() if $disabled{"deprecated-3.0"}; "" -}
  575. =item B<-ssl_client_engine> I<id>
  576. Specify engine to be used for client certificate operations.
  577. {- output_on() if $disabled{"deprecated-3.0"}; "" -}
  578. {- $OpenSSL::safe::opt_v_item -}
  579. Verification errors are displayed, for debugging, but the command will
  580. proceed unless the B<-verify_return_error> option is used.
  581. =item I<host>:I<port>
  582. Rather than providing B<-connect>, the target hostname and optional port may
  583. be provided as a single positional argument after all options. If neither this
  584. nor B<-connect> are provided, falls back to attempting to connect to
  585. I<localhost> on port I<4433>.
  586. =back
  587. =head1 CONNECTED COMMANDS
  588. If a connection is established with an SSL server then any data received
  589. from the server is displayed and any key presses will be sent to the
  590. server. If end of file is reached then the connection will be closed down. When
  591. used interactively (which means neither B<-quiet> nor B<-ign_eof> have been
  592. given), then certain commands are also recognized which perform special
  593. operations. These commands are a letter which must appear at the start of a
  594. line. They are listed below.
  595. =over 4
  596. =item B<Q>
  597. End the current SSL connection and exit.
  598. =item B<R>
  599. Renegotiate the SSL session (TLSv1.2 and below only).
  600. =item B<k>
  601. Send a key update message to the server (TLSv1.3 only)
  602. =item B<K>
  603. Send a key update message to the server and request one back (TLSv1.3 only)
  604. =back
  605. =head1 NOTES
  606. This command can be used to debug SSL servers. To connect to an SSL HTTP
  607. server the command:
  608. openssl s_client -connect servername:443
  609. would typically be used (https uses port 443). If the connection succeeds
  610. then an HTTP command can be given such as "GET /" to retrieve a web page.
  611. If the handshake fails then there are several possible causes, if it is
  612. nothing obvious like no client certificate then the B<-bugs>,
  613. B<-ssl3>, B<-tls1>, B<-no_ssl3>, B<-no_tls1> options can be tried
  614. in case it is a buggy server. In particular you should play with these
  615. options B<before> submitting a bug report to an OpenSSL mailing list.
  616. A frequent problem when attempting to get client certificates working
  617. is that a web client complains it has no certificates or gives an empty
  618. list to choose from. This is normally because the server is not sending
  619. the clients certificate authority in its "acceptable CA list" when it
  620. requests a certificate. By using this command, the CA list can be viewed
  621. and checked. However, some servers only request client authentication
  622. after a specific URL is requested. To obtain the list in this case it
  623. is necessary to use the B<-prexit> option and send an HTTP request
  624. for an appropriate page.
  625. If a certificate is specified on the command line using the B<-cert>
  626. option it will not be used unless the server specifically requests
  627. a client certificate. Therefore, merely including a client certificate
  628. on the command line is no guarantee that the certificate works.
  629. If there are problems verifying a server certificate then the
  630. B<-showcerts> option can be used to show all the certificates sent by the
  631. server.
  632. This command is a test tool and is designed to continue the
  633. handshake after any certificate verification errors. As a result it will
  634. accept any certificate chain (trusted or not) sent by the peer. Non-test
  635. applications should B<not> do this as it makes them vulnerable to a MITM
  636. attack. This behaviour can be changed by with the B<-verify_return_error>
  637. option: any verify errors are then returned aborting the handshake.
  638. The B<-bind> option may be useful if the server or a firewall requires
  639. connections to come from some particular address and or port.
  640. =head1 BUGS
  641. Because this program has a lot of options and also because some of the
  642. techniques used are rather old, the C source for this command is rather
  643. hard to read and not a model of how things should be done.
  644. A typical SSL client program would be much simpler.
  645. The B<-prexit> option is a bit of a hack. We should really report
  646. information whenever a session is renegotiated.
  647. =head1 SEE ALSO
  648. L<openssl(1)>,
  649. L<openssl-sess_id(1)>,
  650. L<openssl-s_server(1)>,
  651. L<openssl-ciphers(1)>,
  652. L<SSL_CONF_cmd(3)>,
  653. L<SSL_CTX_set_max_send_fragment(3)>,
  654. L<SSL_CTX_set_split_send_fragment(3)>,
  655. L<SSL_CTX_set_max_pipelines(3)>,
  656. L<ossl_store-file(7)>
  657. =head1 HISTORY
  658. The B<-no_alt_chains> option was added in OpenSSL 1.1.0.
  659. The B<-name> option was added in OpenSSL 1.1.1.
  660. The B<-certform> option has become obsolete in OpenSSL 3.0.0 and has no effect.
  661. The B<-engine> option was deprecated in OpenSSL 3.0.
  662. The B<-tfo>, B<-no_tx_cert_comp>, and B<-no_rx_cert_comp> options were added
  663. in OpenSSL 3.2.
  664. =head1 COPYRIGHT
  665. Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.
  666. Licensed under the Apache License 2.0 (the "License"). You may not use
  667. this file except in compliance with the License. You can obtain a copy
  668. in the file LICENSE in the source distribution or at
  669. L<https://www.openssl.org/source/license.html>.
  670. =cut