openssl-s_client.1ossl 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "OPENSSL-S_CLIENT 1ossl"
  58. .TH OPENSSL-S_CLIENT 1ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. openssl\-s_client \- SSL/TLS client program
  65. .SH SYNOPSIS
  66. .IX Header "SYNOPSIS"
  67. \&\fBopenssl\fR \fBs_client\fR
  68. [\fB\-help\fR]
  69. [\fB\-ssl_config\fR \fIsection\fR]
  70. [\fB\-connect\fR \fIhost\fR:\fIport\fR]
  71. [\fB\-host\fR \fIhostname\fR]
  72. [\fB\-port\fR \fIport\fR]
  73. [\fB\-bind\fR \fIhost\fR:\fIport\fR]
  74. [\fB\-proxy\fR \fIhost\fR:\fIport\fR]
  75. [\fB\-proxy_user\fR \fIuserid\fR]
  76. [\fB\-proxy_pass\fR \fIarg\fR]
  77. [\fB\-unix\fR \fIpath\fR]
  78. [\fB\-4\fR]
  79. [\fB\-6\fR]
  80. [\fB\-quic\fR]
  81. [\fB\-servername\fR \fIname\fR]
  82. [\fB\-noservername\fR]
  83. [\fB\-verify\fR \fIdepth\fR]
  84. [\fB\-verify_return_error\fR]
  85. [\fB\-verify_quiet\fR]
  86. [\fB\-verifyCAfile\fR \fIfilename\fR]
  87. [\fB\-verifyCApath\fR \fIdir\fR]
  88. [\fB\-verifyCAstore\fR \fIuri\fR]
  89. [\fB\-cert\fR \fIfilename\fR]
  90. [\fB\-certform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR]
  91. [\fB\-cert_chain\fR \fIfilename\fR]
  92. [\fB\-build_chain\fR]
  93. [\fB\-CRL\fR \fIfilename\fR]
  94. [\fB\-CRLform\fR \fBDER\fR|\fBPEM\fR]
  95. [\fB\-crl_download\fR]
  96. [\fB\-key\fR \fIfilename\fR|\fIuri\fR]
  97. [\fB\-keyform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR]
  98. [\fB\-pass\fR \fIarg\fR]
  99. [\fB\-chainCAfile\fR \fIfilename\fR]
  100. [\fB\-chainCApath\fR \fIdirectory\fR]
  101. [\fB\-chainCAstore\fR \fIuri\fR]
  102. [\fB\-requestCAfile\fR \fIfilename\fR]
  103. [\fB\-dane_tlsa_domain\fR \fIdomain\fR]
  104. [\fB\-dane_tlsa_rrdata\fR \fIrrdata\fR]
  105. [\fB\-dane_ee_no_namechecks\fR]
  106. [\fB\-reconnect\fR]
  107. [\fB\-showcerts\fR]
  108. [\fB\-prexit\fR]
  109. [\fB\-no\-interactive\fR]
  110. [\fB\-debug\fR]
  111. [\fB\-trace\fR]
  112. [\fB\-nocommands\fR]
  113. [\fB\-adv\fR]
  114. [\fB\-security_debug\fR]
  115. [\fB\-security_debug_verbose\fR]
  116. [\fB\-msg\fR]
  117. [\fB\-timeout\fR]
  118. [\fB\-mtu\fR \fIsize\fR]
  119. [\fB\-no_etm\fR]
  120. [\fB\-no_ems\fR]
  121. [\fB\-keymatexport\fR \fIlabel\fR]
  122. [\fB\-keymatexportlen\fR \fIlen\fR]
  123. [\fB\-msgfile\fR \fIfilename\fR]
  124. [\fB\-nbio_test\fR]
  125. [\fB\-state\fR]
  126. [\fB\-nbio\fR]
  127. [\fB\-crlf\fR]
  128. [\fB\-ign_eof\fR]
  129. [\fB\-no_ign_eof\fR]
  130. [\fB\-psk_identity\fR \fIidentity\fR]
  131. [\fB\-psk\fR \fIkey\fR]
  132. [\fB\-psk_session\fR \fIfile\fR]
  133. [\fB\-quiet\fR]
  134. [\fB\-sctp\fR]
  135. [\fB\-sctp_label_bug\fR]
  136. [\fB\-fallback_scsv\fR]
  137. [\fB\-async\fR]
  138. [\fB\-maxfraglen\fR \fIlen\fR]
  139. [\fB\-max_send_frag\fR]
  140. [\fB\-split_send_frag\fR]
  141. [\fB\-max_pipelines\fR]
  142. [\fB\-read_buf\fR]
  143. [\fB\-ignore_unexpected_eof\fR]
  144. [\fB\-bugs\fR]
  145. [\fB\-no_tx_cert_comp\fR]
  146. [\fB\-no_rx_cert_comp\fR]
  147. [\fB\-comp\fR]
  148. [\fB\-no_comp\fR]
  149. [\fB\-brief\fR]
  150. [\fB\-legacy_server_connect\fR]
  151. [\fB\-no_legacy_server_connect\fR]
  152. [\fB\-allow_no_dhe_kex\fR]
  153. [\fB\-prefer_no_dhe_kex\fR]
  154. [\fB\-sigalgs\fR \fIsigalglist\fR]
  155. [\fB\-curves\fR \fIcurvelist\fR]
  156. [\fB\-cipher\fR \fIcipherlist\fR]
  157. [\fB\-ciphersuites\fR \fIval\fR]
  158. [\fB\-serverpref\fR]
  159. [\fB\-starttls\fR \fIprotocol\fR]
  160. [\fB\-name\fR \fIhostname\fR]
  161. [\fB\-xmpphost\fR \fIhostname\fR]
  162. [\fB\-name\fR \fIhostname\fR]
  163. [\fB\-tlsextdebug\fR]
  164. [\fB\-no_ticket\fR]
  165. [\fB\-sess_out\fR \fIfilename\fR]
  166. [\fB\-serverinfo\fR \fItypes\fR]
  167. [\fB\-sess_in\fR \fIfilename\fR]
  168. [\fB\-serverinfo\fR \fItypes\fR]
  169. [\fB\-status\fR]
  170. [\fB\-alpn\fR \fIprotocols\fR]
  171. [\fB\-nextprotoneg\fR \fIprotocols\fR]
  172. [\fB\-ct\fR]
  173. [\fB\-noct\fR]
  174. [\fB\-ctlogfile\fR]
  175. [\fB\-keylogfile\fR \fIfile\fR]
  176. [\fB\-early_data\fR \fIfile\fR]
  177. [\fB\-enable_pha\fR]
  178. [\fB\-use_srtp\fR \fIvalue\fR]
  179. [\fB\-srpuser\fR \fIvalue\fR]
  180. [\fB\-srppass\fR \fIvalue\fR]
  181. [\fB\-srp_lateuser\fR]
  182. [\fB\-srp_moregroups\fR]
  183. [\fB\-srp_strength\fR \fInumber\fR]
  184. [\fB\-ktls\fR]
  185. [\fB\-tfo\fR]
  186. [\fB\-nameopt\fR \fIoption\fR]
  187. [\fB\-no_ssl3\fR]
  188. [\fB\-no_tls1\fR]
  189. [\fB\-no_tls1_1\fR]
  190. [\fB\-no_tls1_2\fR]
  191. [\fB\-no_tls1_3\fR]
  192. [\fB\-ssl3\fR]
  193. [\fB\-tls1\fR]
  194. [\fB\-tls1_1\fR]
  195. [\fB\-tls1_2\fR]
  196. [\fB\-tls1_3\fR]
  197. [\fB\-dtls\fR]
  198. [\fB\-dtls1\fR]
  199. [\fB\-dtls1_2\fR]
  200. [\fB\-xkey\fR \fIinfile\fR]
  201. [\fB\-xcert\fR \fIfile\fR]
  202. [\fB\-xchain\fR \fIfile\fR]
  203. [\fB\-xchain_build\fR \fIfile\fR]
  204. [\fB\-xcertform\fR \fBDER\fR|\fBPEM\fR]>
  205. [\fB\-xkeyform\fR \fBDER\fR|\fBPEM\fR]>
  206. [\fB\-CAfile\fR \fIfile\fR]
  207. [\fB\-no\-CAfile\fR]
  208. [\fB\-CApath\fR \fIdir\fR]
  209. [\fB\-no\-CApath\fR]
  210. [\fB\-CAstore\fR \fIuri\fR]
  211. [\fB\-no\-CAstore\fR]
  212. [\fB\-bugs\fR]
  213. [\fB\-no_comp\fR]
  214. [\fB\-comp\fR]
  215. [\fB\-no_ticket\fR]
  216. [\fB\-serverpref\fR]
  217. [\fB\-client_renegotiation\fR]
  218. [\fB\-legacy_renegotiation\fR]
  219. [\fB\-no_renegotiation\fR]
  220. [\fB\-no_resumption_on_reneg\fR]
  221. [\fB\-legacy_server_connect\fR]
  222. [\fB\-no_legacy_server_connect\fR]
  223. [\fB\-no_etm\fR]
  224. [\fB\-allow_no_dhe_kex\fR]
  225. [\fB\-prefer_no_dhe_kex\fR]
  226. [\fB\-prioritize_chacha\fR]
  227. [\fB\-strict\fR]
  228. [\fB\-sigalgs\fR \fIalgs\fR]
  229. [\fB\-client_sigalgs\fR \fIalgs\fR]
  230. [\fB\-groups\fR \fIgroups\fR]
  231. [\fB\-curves\fR \fIcurves\fR]
  232. [\fB\-named_curve\fR \fIcurve\fR]
  233. [\fB\-cipher\fR \fIciphers\fR]
  234. [\fB\-ciphersuites\fR \fI1.3ciphers\fR]
  235. [\fB\-min_protocol\fR \fIminprot\fR]
  236. [\fB\-max_protocol\fR \fImaxprot\fR]
  237. [\fB\-record_padding\fR \fIpadding\fR]
  238. [\fB\-debug_broken_protocol\fR]
  239. [\fB\-no_middlebox\fR]
  240. [\fB\-rand\fR \fIfiles\fR]
  241. [\fB\-writerand\fR \fIfile\fR]
  242. [\fB\-provider\fR \fIname\fR]
  243. [\fB\-provider\-path\fR \fIpath\fR]
  244. [\fB\-propquery\fR \fIpropq\fR]
  245. [\fB\-engine\fR \fIid\fR]
  246. [\fB\-ssl_client_engine\fR \fIid\fR]
  247. [\fB\-allow_proxy_certs\fR]
  248. [\fB\-attime\fR \fItimestamp\fR]
  249. [\fB\-no_check_time\fR]
  250. [\fB\-check_ss_sig\fR]
  251. [\fB\-crl_check\fR]
  252. [\fB\-crl_check_all\fR]
  253. [\fB\-explicit_policy\fR]
  254. [\fB\-extended_crl\fR]
  255. [\fB\-ignore_critical\fR]
  256. [\fB\-inhibit_any\fR]
  257. [\fB\-inhibit_map\fR]
  258. [\fB\-partial_chain\fR]
  259. [\fB\-policy\fR \fIarg\fR]
  260. [\fB\-policy_check\fR]
  261. [\fB\-policy_print\fR]
  262. [\fB\-purpose\fR \fIpurpose\fR]
  263. [\fB\-suiteB_128\fR]
  264. [\fB\-suiteB_128_only\fR]
  265. [\fB\-suiteB_192\fR]
  266. [\fB\-trusted_first\fR]
  267. [\fB\-no_alt_chains\fR]
  268. [\fB\-use_deltas\fR]
  269. [\fB\-auth_level\fR \fInum\fR]
  270. [\fB\-verify_depth\fR \fInum\fR]
  271. [\fB\-verify_email\fR \fIemail\fR]
  272. [\fB\-verify_hostname\fR \fIhostname\fR]
  273. [\fB\-verify_ip\fR \fIip\fR]
  274. [\fB\-verify_name\fR \fIname\fR]
  275. [\fB\-x509_strict\fR]
  276. [\fB\-issuer_checks\fR]
  277. [\fB\-enable_server_rpk\fR]
  278. [\fB\-enable_client_rpk\fR]
  279. [\fIhost\fR:\fIport\fR]
  280. .SH DESCRIPTION
  281. .IX Header "DESCRIPTION"
  282. This command implements a generic SSL/TLS client which
  283. connects to a remote host using SSL/TLS. It is a \fIvery\fR useful diagnostic
  284. tool for SSL servers.
  285. .SH OPTIONS
  286. .IX Header "OPTIONS"
  287. In addition to the options below, this command also supports the
  288. common and client only options documented
  289. in the "Supported Command Line Commands" section of the \fBSSL_CONF_cmd\fR\|(3)
  290. manual page.
  291. .IP \fB\-help\fR 4
  292. .IX Item "-help"
  293. Print out a usage message.
  294. .IP "\fB\-ssl_config\fR \fIsection\fR" 4
  295. .IX Item "-ssl_config section"
  296. Use the specified section of the configuration file to configure the \fBSSL_CTX\fR object.
  297. .IP "\fB\-connect\fR \fIhost\fR:\fIport\fR" 4
  298. .IX Item "-connect host:port"
  299. This specifies the host and optional port to connect to. It is possible to
  300. select the host and port using the optional target positional argument instead.
  301. If neither this nor the target positional argument are specified then an attempt
  302. is made to connect to the local host on port 4433.
  303. If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
  304. .IP "\fB\-host\fR \fIhostname\fR" 4
  305. .IX Item "-host hostname"
  306. Host to connect to; use \fB\-connect\fR instead.
  307. .IP "\fB\-port\fR \fIport\fR" 4
  308. .IX Item "-port port"
  309. Connect to the specified port; use \fB\-connect\fR instead.
  310. .IP "\fB\-bind\fR \fIhost\fR:\fIport\fR" 4
  311. .IX Item "-bind host:port"
  312. This specifies the host address and or port to bind as the source for the
  313. connection. For Unix-domain sockets the port is ignored and the host is
  314. used as the source socket address.
  315. If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
  316. .IP "\fB\-proxy\fR \fIhost\fR:\fIport\fR" 4
  317. .IX Item "-proxy host:port"
  318. When used with the \fB\-connect\fR flag, the program uses the host and port
  319. specified with this flag and issues an HTTP CONNECT command to connect
  320. to the desired server.
  321. If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
  322. .IP "\fB\-proxy_user\fR \fIuserid\fR" 4
  323. .IX Item "-proxy_user userid"
  324. When used with the \fB\-proxy\fR flag, the program will attempt to authenticate
  325. with the specified proxy using basic (base64) authentication.
  326. NB: Basic authentication is insecure; the credentials are sent to the proxy
  327. in easily reversible base64 encoding before any TLS/SSL session is established.
  328. Therefore, these credentials are easily recovered by anyone able to sniff/trace
  329. the network. Use with caution.
  330. .IP "\fB\-proxy_pass\fR \fIarg\fR" 4
  331. .IX Item "-proxy_pass arg"
  332. The proxy password source, used with the \fB\-proxy_user\fR flag.
  333. For more information about the format of \fBarg\fR
  334. see \fBopenssl\-passphrase\-options\fR\|(1).
  335. .IP "\fB\-unix\fR \fIpath\fR" 4
  336. .IX Item "-unix path"
  337. Connect over the specified Unix-domain socket.
  338. .IP \fB\-4\fR 4
  339. .IX Item "-4"
  340. Use IPv4 only.
  341. .IP \fB\-6\fR 4
  342. .IX Item "-6"
  343. Use IPv6 only.
  344. .IP \fB\-quic\fR 4
  345. .IX Item "-quic"
  346. Connect using the QUIC protocol. If specified then the \fB\-alpn\fR option must also
  347. be provided.
  348. .IP "\fB\-servername\fR \fIname\fR" 4
  349. .IX Item "-servername name"
  350. Set the TLS SNI (Server Name Indication) extension in the ClientHello message to
  351. the given value.
  352. If \fB\-servername\fR is not provided, the TLS SNI extension will be populated with
  353. the name given to \fB\-connect\fR if it follows a DNS name format. If \fB\-connect\fR is
  354. not provided either, the SNI is set to "localhost".
  355. This is the default since OpenSSL 1.1.1.
  356. .Sp
  357. Even though SNI should normally be a DNS name and not an IP address, if
  358. \&\fB\-servername\fR is provided then that name will be sent, regardless of whether
  359. it is a DNS name or not.
  360. .Sp
  361. This option cannot be used in conjunction with \fB\-noservername\fR.
  362. .IP \fB\-noservername\fR 4
  363. .IX Item "-noservername"
  364. Suppresses sending of the SNI (Server Name Indication) extension in the
  365. ClientHello message. Cannot be used in conjunction with the \fB\-servername\fR or
  366. \&\fB\-dane_tlsa_domain\fR options.
  367. .IP "\fB\-cert\fR \fIfilename\fR" 4
  368. .IX Item "-cert filename"
  369. The client certificate to use, if one is requested by the server.
  370. The default is not to use a certificate.
  371. .Sp
  372. The chain for the client certificate may be specified using \fB\-cert_chain\fR.
  373. .IP "\fB\-certform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR" 4
  374. .IX Item "-certform DER|PEM|P12"
  375. The client certificate file format to use; unspecified by default.
  376. See \fBopenssl\-format\-options\fR\|(1) for details.
  377. .IP \fB\-cert_chain\fR 4
  378. .IX Item "-cert_chain"
  379. A file or URI of untrusted certificates to use when attempting to build the
  380. certificate chain related to the certificate specified via the \fB\-cert\fR option.
  381. The input can be in PEM, DER, or PKCS#12 format.
  382. .IP \fB\-build_chain\fR 4
  383. .IX Item "-build_chain"
  384. Specify whether the application should build the client certificate chain to be
  385. provided to the server.
  386. .IP "\fB\-CRL\fR \fIfilename\fR" 4
  387. .IX Item "-CRL filename"
  388. CRL file to use to check the server's certificate.
  389. .IP "\fB\-CRLform\fR \fBDER\fR|\fBPEM\fR" 4
  390. .IX Item "-CRLform DER|PEM"
  391. The CRL file format; unspecified by default.
  392. See \fBopenssl\-format\-options\fR\|(1) for details.
  393. .IP \fB\-crl_download\fR 4
  394. .IX Item "-crl_download"
  395. Download CRL from distribution points in the certificate. Note that this option
  396. is ignored if \fB\-crl_check\fR option is not provided. Note that the maximum size
  397. of CRL is limited by \fBX509_CRL_load_http\fR\|(3) function.
  398. .IP "\fB\-key\fR \fIfilename\fR|\fIuri\fR" 4
  399. .IX Item "-key filename|uri"
  400. The client private key to use.
  401. If not specified then the certificate file will be used to read also the key.
  402. .IP "\fB\-keyform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR" 4
  403. .IX Item "-keyform DER|PEM|P12|ENGINE"
  404. The key format; unspecified by default.
  405. See \fBopenssl\-format\-options\fR\|(1) for details.
  406. .IP "\fB\-pass\fR \fIarg\fR" 4
  407. .IX Item "-pass arg"
  408. the private key and certificate file password source.
  409. For more information about the format of \fIarg\fR
  410. see \fBopenssl\-passphrase\-options\fR\|(1).
  411. .IP "\fB\-verify\fR \fIdepth\fR" 4
  412. .IX Item "-verify depth"
  413. The verify depth to use. This specifies the maximum length of the
  414. server certificate chain and turns on server certificate verification.
  415. Currently the verify operation continues after errors so all the problems
  416. with a certificate chain can be seen. As a side effect the connection
  417. will never fail due to a server certificate verify failure.
  418. .IP \fB\-verify_return_error\fR 4
  419. .IX Item "-verify_return_error"
  420. Return verification errors instead of continuing. This will typically
  421. abort the handshake with a fatal error.
  422. .IP \fB\-verify_quiet\fR 4
  423. .IX Item "-verify_quiet"
  424. Limit verify output to only errors.
  425. .IP "\fB\-verifyCAfile\fR \fIfilename\fR" 4
  426. .IX Item "-verifyCAfile filename"
  427. A file in PEM format containing trusted certificates to use
  428. for verifying the server's certificate.
  429. .IP "\fB\-verifyCApath\fR \fIdir\fR" 4
  430. .IX Item "-verifyCApath dir"
  431. A directory containing trusted certificates to use
  432. for verifying the server's certificate.
  433. This directory must be in "hash format",
  434. see \fBopenssl\-verify\fR\|(1) for more information.
  435. .IP "\fB\-verifyCAstore\fR \fIuri\fR" 4
  436. .IX Item "-verifyCAstore uri"
  437. The URI of a store containing trusted certificates to use
  438. for verifying the server's certificate.
  439. .IP "\fB\-chainCAfile\fR \fIfile\fR" 4
  440. .IX Item "-chainCAfile file"
  441. A file in PEM format containing trusted certificates to use
  442. when attempting to build the client certificate chain.
  443. .IP "\fB\-chainCApath\fR \fIdirectory\fR" 4
  444. .IX Item "-chainCApath directory"
  445. A directory containing trusted certificates to use
  446. for building the client certificate chain provided to the server.
  447. This directory must be in "hash format",
  448. see \fBopenssl\-verify\fR\|(1) for more information.
  449. .IP "\fB\-chainCAstore\fR \fIuri\fR" 4
  450. .IX Item "-chainCAstore uri"
  451. The URI of a store containing trusted certificates to use
  452. when attempting to build the client certificate chain.
  453. The URI may indicate a single certificate, as well as a collection of them.
  454. With URIs in the \f(CW\*(C`file:\*(C'\fR scheme, this acts as \fB\-chainCAfile\fR or
  455. \&\fB\-chainCApath\fR, depending on if the URI indicates a directory or a
  456. single file.
  457. See \fBossl_store\-file\fR\|(7) for more information on the \f(CW\*(C`file:\*(C'\fR scheme.
  458. .IP "\fB\-requestCAfile\fR \fIfile\fR" 4
  459. .IX Item "-requestCAfile file"
  460. A file containing a list of certificates whose subject names will be sent
  461. to the server in the \fBcertificate_authorities\fR extension. Only supported
  462. for TLS 1.3
  463. .IP "\fB\-dane_tlsa_domain\fR \fIdomain\fR" 4
  464. .IX Item "-dane_tlsa_domain domain"
  465. Enable RFC6698/RFC7671 DANE TLSA authentication and specify the
  466. TLSA base domain which becomes the default SNI hint and the primary
  467. reference identifier for hostname checks. This must be used in
  468. combination with at least one instance of the \fB\-dane_tlsa_rrdata\fR
  469. option below.
  470. .Sp
  471. When DANE authentication succeeds, the diagnostic output will include
  472. the lowest (closest to 0) depth at which a TLSA record authenticated
  473. a chain certificate. When that TLSA record is a "2 1 0" trust
  474. anchor public key that signed (rather than matched) the top-most
  475. certificate of the chain, the result is reported as "TA public key
  476. verified". Otherwise, either the TLSA record "matched TA certificate"
  477. at a positive depth or else "matched EE certificate" at depth 0.
  478. .IP "\fB\-dane_tlsa_rrdata\fR \fIrrdata\fR" 4
  479. .IX Item "-dane_tlsa_rrdata rrdata"
  480. Use one or more times to specify the RRDATA fields of the DANE TLSA
  481. RRset associated with the target service. The \fIrrdata\fR value is
  482. specified in "presentation form", that is four whitespace separated
  483. fields that specify the usage, selector, matching type and associated
  484. data, with the last of these encoded in hexadecimal. Optional
  485. whitespace is ignored in the associated data field. For example:
  486. .Sp
  487. .Vb 12
  488. \& $ openssl s_client \-brief \-starttls smtp \e
  489. \& \-connect smtp.example.com:25 \e
  490. \& \-dane_tlsa_domain smtp.example.com \e
  491. \& \-dane_tlsa_rrdata "2 1 1
  492. \& B111DD8A1C2091A89BD4FD60C57F0716CCE50FEEFF8137CDBEE0326E 02CF362B" \e
  493. \& \-dane_tlsa_rrdata "2 1 1
  494. \& 60B87575447DCBA2A36B7D11AC09FB24A9DB406FEE12D2CC90180517 616E8A18"
  495. \& ...
  496. \& Verification: OK
  497. \& Verified peername: smtp.example.com
  498. \& DANE TLSA 2 1 1 ...ee12d2cc90180517616e8a18 matched TA certificate at depth 1
  499. \& ...
  500. .Ve
  501. .IP \fB\-dane_ee_no_namechecks\fR 4
  502. .IX Item "-dane_ee_no_namechecks"
  503. This disables server name checks when authenticating via \fBDANE\-EE\fR\|(3) TLSA
  504. records.
  505. For some applications, primarily web browsers, it is not safe to disable name
  506. checks due to "unknown key share" attacks, in which a malicious server can
  507. convince a client that a connection to a victim server is instead a secure
  508. connection to the malicious server.
  509. The malicious server may then be able to violate cross-origin scripting
  510. restrictions.
  511. Thus, despite the text of RFC7671, name checks are by default enabled for
  512. \&\fBDANE\-EE\fR\|(3) TLSA records, and can be disabled in applications where it is safe
  513. to do so.
  514. In particular, SMTP and XMPP clients should set this option as SRV and MX
  515. records already make it possible for a remote domain to redirect client
  516. connections to any server of its choice, and in any case SMTP and XMPP clients
  517. do not execute scripts downloaded from remote servers.
  518. .IP \fB\-reconnect\fR 4
  519. .IX Item "-reconnect"
  520. Reconnects to the same server 5 times using the same session ID, this can
  521. be used as a test that session caching is working.
  522. .IP \fB\-showcerts\fR 4
  523. .IX Item "-showcerts"
  524. Displays the server certificate list as sent by the server: it only consists of
  525. certificates the server has sent (in the order the server has sent them). It is
  526. \&\fBnot\fR a verified chain.
  527. .IP \fB\-prexit\fR 4
  528. .IX Item "-prexit"
  529. Print session information when the program exits. This will always attempt
  530. to print out information even if the connection fails. Normally information
  531. will only be printed out once if the connection succeeds. This option is useful
  532. because the cipher in use may be renegotiated or the connection may fail
  533. because a client certificate is required or is requested only after an
  534. attempt is made to access a certain URL. Note: the output produced by this
  535. option is not always accurate because a connection might never have been
  536. established.
  537. .IP \fB\-no\-interactive\fR 4
  538. .IX Item "-no-interactive"
  539. This flag can be used to run the client in a non-interactive mode.
  540. .IP \fB\-state\fR 4
  541. .IX Item "-state"
  542. Prints out the SSL session states.
  543. .IP \fB\-debug\fR 4
  544. .IX Item "-debug"
  545. Print extensive debugging information including a hex dump of all traffic.
  546. .IP \fB\-nocommands\fR 4
  547. .IX Item "-nocommands"
  548. Do not use interactive command letters.
  549. .IP \fB\-adv\fR 4
  550. .IX Item "-adv"
  551. Use advanced command mode.
  552. .IP \fB\-security_debug\fR 4
  553. .IX Item "-security_debug"
  554. Enable security debug messages.
  555. .IP \fB\-security_debug_verbose\fR 4
  556. .IX Item "-security_debug_verbose"
  557. Output more security debug output.
  558. .IP \fB\-msg\fR 4
  559. .IX Item "-msg"
  560. Show protocol messages.
  561. .IP \fB\-timeout\fR 4
  562. .IX Item "-timeout"
  563. Enable send/receive timeout on DTLS connections.
  564. .IP "\fB\-mtu\fR \fIsize\fR" 4
  565. .IX Item "-mtu size"
  566. Set MTU of the link layer to the specified size.
  567. .IP \fB\-no_etm\fR 4
  568. .IX Item "-no_etm"
  569. Disable Encrypt-then-MAC negotiation.
  570. .IP \fB\-no_ems\fR 4
  571. .IX Item "-no_ems"
  572. Disable Extended master secret negotiation.
  573. .IP "\fB\-keymatexport\fR \fIlabel\fR" 4
  574. .IX Item "-keymatexport label"
  575. Export keying material using the specified label.
  576. .IP "\fB\-keymatexportlen\fR \fIlen\fR" 4
  577. .IX Item "-keymatexportlen len"
  578. Export the specified number of bytes of keying material; default is 20.
  579. .Sp
  580. Show all protocol messages with hex dump.
  581. .IP \fB\-trace\fR 4
  582. .IX Item "-trace"
  583. Show verbose trace output of protocol messages.
  584. .IP "\fB\-msgfile\fR \fIfilename\fR" 4
  585. .IX Item "-msgfile filename"
  586. File to send output of \fB\-msg\fR or \fB\-trace\fR to, default standard output.
  587. .IP \fB\-nbio_test\fR 4
  588. .IX Item "-nbio_test"
  589. Tests nonblocking I/O
  590. .IP \fB\-nbio\fR 4
  591. .IX Item "-nbio"
  592. Turns on nonblocking I/O
  593. .IP \fB\-crlf\fR 4
  594. .IX Item "-crlf"
  595. This option translated a line feed from the terminal into CR+LF as required
  596. by some servers.
  597. .IP \fB\-ign_eof\fR 4
  598. .IX Item "-ign_eof"
  599. Inhibit shutting down the connection when end of file is reached in the
  600. input.
  601. .IP \fB\-quiet\fR 4
  602. .IX Item "-quiet"
  603. Inhibit printing of session and certificate information. This implicitly
  604. turns on \fB\-ign_eof\fR as well.
  605. .IP \fB\-no_ign_eof\fR 4
  606. .IX Item "-no_ign_eof"
  607. Shut down the connection when end of file is reached in the input.
  608. Can be used to override the implicit \fB\-ign_eof\fR after \fB\-quiet\fR.
  609. .IP "\fB\-psk_identity\fR \fIidentity\fR" 4
  610. .IX Item "-psk_identity identity"
  611. Use the PSK identity \fIidentity\fR when using a PSK cipher suite.
  612. The default value is "Client_identity" (without the quotes).
  613. .IP "\fB\-psk\fR \fIkey\fR" 4
  614. .IX Item "-psk key"
  615. Use the PSK key \fIkey\fR when using a PSK cipher suite. The key is
  616. given as a hexadecimal number without leading 0x, for example \-psk
  617. 1a2b3c4d.
  618. This option must be provided in order to use a PSK cipher.
  619. .IP "\fB\-psk_session\fR \fIfile\fR" 4
  620. .IX Item "-psk_session file"
  621. Use the pem encoded SSL_SESSION data stored in \fIfile\fR as the basis of a PSK.
  622. Note that this will only work if TLSv1.3 is negotiated.
  623. .IP \fB\-sctp\fR 4
  624. .IX Item "-sctp"
  625. Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
  626. conjunction with \fB\-dtls\fR, \fB\-dtls1\fR or \fB\-dtls1_2\fR. This option is only
  627. available where OpenSSL has support for SCTP enabled.
  628. .IP \fB\-sctp_label_bug\fR 4
  629. .IX Item "-sctp_label_bug"
  630. Use the incorrect behaviour of older OpenSSL implementations when computing
  631. endpoint-pair shared secrets for DTLS/SCTP. This allows communication with
  632. older broken implementations but breaks interoperability with correct
  633. implementations. Must be used in conjunction with \fB\-sctp\fR. This option is only
  634. available where OpenSSL has support for SCTP enabled.
  635. .IP \fB\-fallback_scsv\fR 4
  636. .IX Item "-fallback_scsv"
  637. Send TLS_FALLBACK_SCSV in the ClientHello.
  638. .IP \fB\-async\fR 4
  639. .IX Item "-async"
  640. Switch on asynchronous mode. Cryptographic operations will be performed
  641. asynchronously. This will only have an effect if an asynchronous capable engine
  642. is also used via the \fB\-engine\fR option. For test purposes the dummy async engine
  643. (dasync) can be used (if available).
  644. .IP "\fB\-maxfraglen\fR \fIlen\fR" 4
  645. .IX Item "-maxfraglen len"
  646. Enable Maximum Fragment Length Negotiation; allowed values are
  647. \&\f(CW512\fR, \f(CW1024\fR, \f(CW2048\fR, and \f(CW4096\fR.
  648. .IP "\fB\-max_send_frag\fR \fIint\fR" 4
  649. .IX Item "-max_send_frag int"
  650. The maximum size of data fragment to send.
  651. See \fBSSL_CTX_set_max_send_fragment\fR\|(3) for further information.
  652. .IP "\fB\-split_send_frag\fR \fIint\fR" 4
  653. .IX Item "-split_send_frag int"
  654. The size used to split data for encrypt pipelines. If more data is written in
  655. one go than this value then it will be split into multiple pipelines, up to the
  656. maximum number of pipelines defined by max_pipelines. This only has an effect if
  657. a suitable cipher suite has been negotiated, an engine that supports pipelining
  658. has been loaded, and max_pipelines is greater than 1. See
  659. \&\fBSSL_CTX_set_split_send_fragment\fR\|(3) for further information.
  660. .IP "\fB\-max_pipelines\fR \fIint\fR" 4
  661. .IX Item "-max_pipelines int"
  662. The maximum number of encrypt/decrypt pipelines to be used. This will only have
  663. an effect if an engine has been loaded that supports pipelining (e.g. the dasync
  664. engine) and a suitable cipher suite has been negotiated. The default value is 1.
  665. See \fBSSL_CTX_set_max_pipelines\fR\|(3) for further information.
  666. .IP "\fB\-read_buf\fR \fIint\fR" 4
  667. .IX Item "-read_buf int"
  668. The default read buffer size to be used for connections. This will only have an
  669. effect if the buffer size is larger than the size that would otherwise be used
  670. and pipelining is in use (see \fBSSL_CTX_set_default_read_buffer_len\fR\|(3) for
  671. further information).
  672. .IP \fB\-ignore_unexpected_eof\fR 4
  673. .IX Item "-ignore_unexpected_eof"
  674. Some TLS implementations do not send the mandatory close_notify alert on
  675. shutdown. If the application tries to wait for the close_notify alert but the
  676. peer closes the connection without sending it, an error is generated. When this
  677. option is enabled the peer does not need to send the close_notify alert and a
  678. closed connection will be treated as if the close_notify alert was received.
  679. For more information on shutting down a connection, see \fBSSL_shutdown\fR\|(3).
  680. .IP \fB\-bugs\fR 4
  681. .IX Item "-bugs"
  682. There are several known bugs in SSL and TLS implementations. Adding this
  683. option enables various workarounds.
  684. .IP \fB\-no_tx_cert_comp\fR 4
  685. .IX Item "-no_tx_cert_comp"
  686. Disables support for sending TLSv1.3 compressed certificates.
  687. .IP \fB\-no_rx_cert_comp\fR 4
  688. .IX Item "-no_rx_cert_comp"
  689. Disables support for receiving TLSv1.3 compressed certificate.
  690. .IP \fB\-comp\fR 4
  691. .IX Item "-comp"
  692. Enables support for SSL/TLS compression.
  693. This option was introduced in OpenSSL 1.1.0.
  694. TLS compression is not recommended and is off by default as of
  695. OpenSSL 1.1.0. TLS compression can only be used in security level 1 or
  696. lower. From OpenSSL 3.2.0 and above the default security level is 2, so this
  697. option will have no effect without also changing the security level. Use the
  698. \&\fB\-cipher\fR option to change the security level. See \fBopenssl\-ciphers\fR\|(1) for
  699. more information.
  700. .IP \fB\-no_comp\fR 4
  701. .IX Item "-no_comp"
  702. Disables support for SSL/TLS compression.
  703. TLS compression is not recommended and is off by default as of
  704. OpenSSL 1.1.0.
  705. .IP \fB\-brief\fR 4
  706. .IX Item "-brief"
  707. Only provide a brief summary of connection parameters instead of the
  708. normal verbose output.
  709. .IP "\fB\-sigalgs\fR \fIsigalglist\fR" 4
  710. .IX Item "-sigalgs sigalglist"
  711. Specifies the list of signature algorithms that are sent by the client.
  712. The server selects one entry in the list based on its preferences.
  713. For example strings, see \fBSSL_CTX_set1_sigalgs\fR\|(3)
  714. .IP "\fB\-curves\fR \fIcurvelist\fR" 4
  715. .IX Item "-curves curvelist"
  716. Specifies the list of supported curves to be sent by the client. The curve is
  717. ultimately selected by the server.
  718. .Sp
  719. The list of all supported groups includes named EC parameters as well as X25519
  720. and X448 or FFDHE groups, and may also include groups implemented in 3rd\-party
  721. providers. For a list of named EC parameters, use:
  722. .Sp
  723. .Vb 1
  724. \& $ openssl ecparam \-list_curves
  725. .Ve
  726. .IP "\fB\-cipher\fR \fIcipherlist\fR" 4
  727. .IX Item "-cipher cipherlist"
  728. This allows the TLSv1.2 and below cipher list sent by the client to be modified.
  729. This list will be combined with any TLSv1.3 ciphersuites that have been
  730. configured. Although the server determines which ciphersuite is used it should
  731. take the first supported cipher in the list sent by the client. See
  732. \&\fBopenssl\-ciphers\fR\|(1) for more information.
  733. .IP "\fB\-ciphersuites\fR \fIval\fR" 4
  734. .IX Item "-ciphersuites val"
  735. This allows the TLSv1.3 ciphersuites sent by the client to be modified. This
  736. list will be combined with any TLSv1.2 and below ciphersuites that have been
  737. configured. Although the server determines which cipher suite is used it should
  738. take the first supported cipher in the list sent by the client. See
  739. \&\fBopenssl\-ciphers\fR\|(1) for more information. The format for this list is a simple
  740. colon (":") separated list of TLSv1.3 ciphersuite names.
  741. .IP "\fB\-starttls\fR \fIprotocol\fR" 4
  742. .IX Item "-starttls protocol"
  743. Send the protocol-specific message(s) to switch to TLS for communication.
  744. \&\fIprotocol\fR is a keyword for the intended protocol. Currently, the only
  745. supported keywords are "smtp", "pop3", "imap", "ftp", "xmpp", "xmpp-server",
  746. "irc", "postgres", "mysql", "lmtp", "nntp", "sieve" and "ldap".
  747. .IP "\fB\-xmpphost\fR \fIhostname\fR" 4
  748. .IX Item "-xmpphost hostname"
  749. This option, when used with "\-starttls xmpp" or "\-starttls xmpp-server",
  750. specifies the host for the "to" attribute of the stream element.
  751. If this option is not specified, then the host specified with "\-connect"
  752. will be used.
  753. .Sp
  754. This option is an alias of the \fB\-name\fR option for "xmpp" and "xmpp-server".
  755. .IP "\fB\-name\fR \fIhostname\fR" 4
  756. .IX Item "-name hostname"
  757. This option is used to specify hostname information for various protocols
  758. used with \fB\-starttls\fR option. Currently only "xmpp", "xmpp-server",
  759. "smtp" and "lmtp" can utilize this \fB\-name\fR option.
  760. .Sp
  761. If this option is used with "\-starttls xmpp" or "\-starttls xmpp-server",
  762. if specifies the host for the "to" attribute of the stream element. If this
  763. option is not specified, then the host specified with "\-connect" will be used.
  764. .Sp
  765. If this option is used with "\-starttls lmtp" or "\-starttls smtp", it specifies
  766. the name to use in the "LMTP LHLO" or "SMTP EHLO" message, respectively. If
  767. this option is not specified, then "mail.example.com" will be used.
  768. .IP \fB\-tlsextdebug\fR 4
  769. .IX Item "-tlsextdebug"
  770. Print out a hex dump of any TLS extensions received from the server.
  771. .IP \fB\-no_ticket\fR 4
  772. .IX Item "-no_ticket"
  773. Disable RFC4507bis session ticket support.
  774. .IP "\fB\-sess_out\fR \fIfilename\fR" 4
  775. .IX Item "-sess_out filename"
  776. Output SSL session to \fIfilename\fR.
  777. .IP "\fB\-sess_in\fR \fIfilename\fR" 4
  778. .IX Item "-sess_in filename"
  779. Load SSL session from \fIfilename\fR. The client will attempt to resume a
  780. connection from this session.
  781. .IP "\fB\-serverinfo\fR \fItypes\fR" 4
  782. .IX Item "-serverinfo types"
  783. A list of comma-separated TLS Extension Types (numbers between 0 and
  784. 65535). Each type will be sent as an empty ClientHello TLS Extension.
  785. The server's response (if any) will be encoded and displayed as a PEM
  786. file.
  787. .IP \fB\-status\fR 4
  788. .IX Item "-status"
  789. Sends a certificate status request to the server (OCSP stapling). The server
  790. response (if any) is printed out.
  791. .IP "\fB\-alpn\fR \fIprotocols\fR, \fB\-nextprotoneg\fR \fIprotocols\fR" 4
  792. .IX Item "-alpn protocols, -nextprotoneg protocols"
  793. These flags enable the Enable the Application-Layer Protocol Negotiation
  794. or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the
  795. IETF standard and replaces NPN.
  796. The \fIprotocols\fR list is a comma-separated list of protocol names that
  797. the client should advertise support for. The list should contain the most
  798. desirable protocols first. Protocol names are printable ASCII strings,
  799. for example "http/1.1" or "spdy/3".
  800. An empty list of protocols is treated specially and will cause the
  801. client to advertise support for the TLS extension but disconnect just
  802. after receiving ServerHello with a list of server supported protocols.
  803. The flag \fB\-nextprotoneg\fR cannot be specified if \fB\-tls1_3\fR is used.
  804. .IP "\fB\-ct\fR, \fB\-noct\fR" 4
  805. .IX Item "-ct, -noct"
  806. Use one of these two options to control whether Certificate Transparency (CT)
  807. is enabled (\fB\-ct\fR) or disabled (\fB\-noct\fR).
  808. If CT is enabled, signed certificate timestamps (SCTs) will be requested from
  809. the server and reported at handshake completion.
  810. .Sp
  811. Enabling CT also enables OCSP stapling, as this is one possible delivery method
  812. for SCTs.
  813. .IP \fB\-ctlogfile\fR 4
  814. .IX Item "-ctlogfile"
  815. A file containing a list of known Certificate Transparency logs. See
  816. \&\fBSSL_CTX_set_ctlog_list_file\fR\|(3) for the expected file format.
  817. .IP "\fB\-keylogfile\fR \fIfile\fR" 4
  818. .IX Item "-keylogfile file"
  819. Appends TLS secrets to the specified keylog file such that external programs
  820. (like Wireshark) can decrypt TLS connections.
  821. .IP "\fB\-early_data\fR \fIfile\fR" 4
  822. .IX Item "-early_data file"
  823. Reads the contents of the specified file and attempts to send it as early data
  824. to the server. This will only work with resumed sessions that support early
  825. data and when the server accepts the early data.
  826. .IP \fB\-enable_pha\fR 4
  827. .IX Item "-enable_pha"
  828. For TLSv1.3 only, send the Post-Handshake Authentication extension. This will
  829. happen whether or not a certificate has been provided via \fB\-cert\fR.
  830. .IP "\fB\-use_srtp\fR \fIvalue\fR" 4
  831. .IX Item "-use_srtp value"
  832. Offer SRTP key management, where \fBvalue\fR is a colon-separated profile list.
  833. .IP "\fB\-srpuser\fR \fIvalue\fR" 4
  834. .IX Item "-srpuser value"
  835. Set the SRP username to the specified value. This option is deprecated.
  836. .IP "\fB\-srppass\fR \fIvalue\fR" 4
  837. .IX Item "-srppass value"
  838. Set the SRP password to the specified value. This option is deprecated.
  839. .IP \fB\-srp_lateuser\fR 4
  840. .IX Item "-srp_lateuser"
  841. SRP username for the second ClientHello message. This option is deprecated.
  842. .IP "\fB\-srp_moregroups\fR This option is deprecated." 4
  843. .IX Item "-srp_moregroups This option is deprecated."
  844. Tolerate other than the known \fBg\fR and \fBN\fR values.
  845. .IP "\fB\-srp_strength\fR \fInumber\fR" 4
  846. .IX Item "-srp_strength number"
  847. Set the minimal acceptable length, in bits, for \fBN\fR. This option is
  848. deprecated.
  849. .IP \fB\-ktls\fR 4
  850. .IX Item "-ktls"
  851. Enable Kernel TLS for sending and receiving.
  852. This option was introduced in OpenSSL 3.2.0.
  853. Kernel TLS is off by default as of OpenSSL 3.2.0.
  854. .IP \fB\-tfo\fR 4
  855. .IX Item "-tfo"
  856. Enable creation of connections via TCP fast open (RFC7413).
  857. .IP "\fB\-no_ssl3\fR, \fB\-no_tls1\fR, \fB\-no_tls1_1\fR, \fB\-no_tls1_2\fR, \fB\-no_tls1_3\fR, \fB\-ssl3\fR, \fB\-tls1\fR, \fB\-tls1_1\fR, \fB\-tls1_2\fR, \fB\-tls1_3\fR" 4
  858. .IX Item "-no_ssl3, -no_tls1, -no_tls1_1, -no_tls1_2, -no_tls1_3, -ssl3, -tls1, -tls1_1, -tls1_2, -tls1_3"
  859. See "TLS Version Options" in \fBopenssl\fR\|(1).
  860. .IP "\fB\-dtls\fR, \fB\-dtls1\fR, \fB\-dtls1_2\fR" 4
  861. .IX Item "-dtls, -dtls1, -dtls1_2"
  862. These specify the use of DTLS instead of TLS.
  863. See "TLS Version Options" in \fBopenssl\fR\|(1).
  864. .IP "\fB\-nameopt\fR \fIoption\fR" 4
  865. .IX Item "-nameopt option"
  866. This specifies how the subject or issuer names are displayed.
  867. See \fBopenssl\-namedisplay\-options\fR\|(1) for details.
  868. .IP "\fB\-xkey\fR \fIinfile\fR, \fB\-xcert\fR \fIfile\fR, \fB\-xchain\fR \fIfile\fR, \fB\-xchain_build\fR \fIfile\fR, \fB\-xcertform\fR \fBDER\fR|\fBPEM\fR, \fB\-xkeyform\fR \fBDER\fR|\fBPEM\fR" 4
  869. .IX Item "-xkey infile, -xcert file, -xchain file, -xchain_build file, -xcertform DER|PEM, -xkeyform DER|PEM"
  870. Set extended certificate verification options.
  871. See "Extended Verification Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
  872. .IP "\fB\-CAfile\fR \fIfile\fR, \fB\-no\-CAfile\fR, \fB\-CApath\fR \fIdir\fR, \fB\-no\-CApath\fR, \fB\-CAstore\fR \fIuri\fR, \fB\-no\-CAstore\fR" 4
  873. .IX Item "-CAfile file, -no-CAfile, -CApath dir, -no-CApath, -CAstore uri, -no-CAstore"
  874. See "Trusted Certificate Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
  875. .IP "\fB\-bugs\fR, \fB\-comp\fR, \fB\-no_comp\fR, \fB\-no_ticket\fR, \fB\-serverpref\fR, \fB\-client_renegotiation\fR, \fB\-legacy_renegotiation\fR, \fB\-no_renegotiation\fR, \fB\-no_resumption_on_reneg\fR, \fB\-legacy_server_connect\fR, \fB\-no_legacy_server_connect\fR, \fB\-no_etm\fR \fB\-allow_no_dhe_kex\fR, \fB\-prefer_no_dhe_kex\fR, \fB\-prioritize_chacha\fR, \fB\-strict\fR, \fB\-sigalgs\fR \fIalgs\fR, \fB\-client_sigalgs\fR \fIalgs\fR, \fB\-groups\fR \fIgroups\fR, \fB\-curves\fR \fIcurves\fR, \fB\-named_curve\fR \fIcurve\fR, \fB\-cipher\fR \fIciphers\fR, \fB\-ciphersuites\fR \fI1.3ciphers\fR, \fB\-min_protocol\fR \fIminprot\fR, \fB\-max_protocol\fR \fImaxprot\fR, \fB\-record_padding\fR \fIpadding\fR, \fB\-debug_broken_protocol\fR, \fB\-no_middlebox\fR" 4
  876. .IX Item "-bugs, -comp, -no_comp, -no_ticket, -serverpref, -client_renegotiation, -legacy_renegotiation, -no_renegotiation, -no_resumption_on_reneg, -legacy_server_connect, -no_legacy_server_connect, -no_etm -allow_no_dhe_kex, -prefer_no_dhe_kex, -prioritize_chacha, -strict, -sigalgs algs, -client_sigalgs algs, -groups groups, -curves curves, -named_curve curve, -cipher ciphers, -ciphersuites 1.3ciphers, -min_protocol minprot, -max_protocol maxprot, -record_padding padding, -debug_broken_protocol, -no_middlebox"
  877. See "SUPPORTED COMMAND LINE COMMANDS" in \fBSSL_CONF_cmd\fR\|(3) for details.
  878. .IP "\fB\-rand\fR \fIfiles\fR, \fB\-writerand\fR \fIfile\fR" 4
  879. .IX Item "-rand files, -writerand file"
  880. See "Random State Options" in \fBopenssl\fR\|(1) for details.
  881. .IP "\fB\-provider\fR \fIname\fR" 4
  882. .IX Item "-provider name"
  883. .PD 0
  884. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  885. .IX Item "-provider-path path"
  886. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  887. .IX Item "-propquery propq"
  888. .PD
  889. See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  890. .IP "\fB\-engine\fR \fIid\fR" 4
  891. .IX Item "-engine id"
  892. See "Engine Options" in \fBopenssl\fR\|(1).
  893. This option is deprecated.
  894. .IP "\fB\-ssl_client_engine\fR \fIid\fR" 4
  895. .IX Item "-ssl_client_engine id"
  896. Specify engine to be used for client certificate operations.
  897. .IP "\fB\-allow_proxy_certs\fR, \fB\-attime\fR, \fB\-no_check_time\fR, \fB\-check_ss_sig\fR, \fB\-crl_check\fR, \fB\-crl_check_all\fR, \fB\-explicit_policy\fR, \fB\-extended_crl\fR, \fB\-ignore_critical\fR, \fB\-inhibit_any\fR, \fB\-inhibit_map\fR, \fB\-no_alt_chains\fR, \fB\-partial_chain\fR, \fB\-policy\fR, \fB\-policy_check\fR, \fB\-policy_print\fR, \fB\-purpose\fR, \fB\-suiteB_128\fR, \fB\-suiteB_128_only\fR, \fB\-suiteB_192\fR, \fB\-trusted_first\fR, \fB\-use_deltas\fR, \fB\-auth_level\fR, \fB\-verify_depth\fR, \fB\-verify_email\fR, \fB\-verify_hostname\fR, \fB\-verify_ip\fR, \fB\-verify_name\fR, \fB\-x509_strict\fR \fB\-issuer_checks\fR" 4
  898. .IX Item "-allow_proxy_certs, -attime, -no_check_time, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -partial_chain, -policy, -policy_check, -policy_print, -purpose, -suiteB_128, -suiteB_128_only, -suiteB_192, -trusted_first, -use_deltas, -auth_level, -verify_depth, -verify_email, -verify_hostname, -verify_ip, -verify_name, -x509_strict -issuer_checks"
  899. Set various options of certificate chain verification.
  900. See "Verification Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
  901. .Sp
  902. Verification errors are displayed, for debugging, but the command will
  903. proceed unless the \fB\-verify_return_error\fR option is used.
  904. .IP \fB\-enable_server_rpk\fR 4
  905. .IX Item "-enable_server_rpk"
  906. Enable support for receiving raw public keys (RFC7250) from the server.
  907. Use of X.509 certificates by the server becomes optional, and servers that
  908. support raw public keys may elect to use them.
  909. Servers that don't support raw public keys or prefer to use X.509
  910. certificates can still elect to send X.509 certificates as usual.
  911. .IP \fB\-enable_client_rpk\fR 4
  912. .IX Item "-enable_client_rpk"
  913. Enable support for sending raw public keys (RFC7250) to the server.
  914. A raw public key will be sent by the client, if solicited by the server,
  915. provided a suitable key and public certificate pair is configured.
  916. Some servers may nevertheless not request any client credentials,
  917. or may request a certificate.
  918. .IP \fIhost\fR:\fIport\fR 4
  919. .IX Item "host:port"
  920. Rather than providing \fB\-connect\fR, the target host and optional port may
  921. be provided as a single positional argument after all options. If neither this
  922. nor \fB\-connect\fR are provided, falls back to attempting to connect to
  923. \&\fIlocalhost\fR on port \fI4433\fR.
  924. If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
  925. .SH "CONNECTED COMMANDS (BASIC)"
  926. .IX Header "CONNECTED COMMANDS (BASIC)"
  927. If a connection is established with an SSL/TLS server then any data received
  928. from the server is displayed and any key presses will be sent to the
  929. server. If end of file is reached then the connection will be closed down.
  930. .PP
  931. When used interactively (which means neither \fB\-quiet\fR nor \fB\-ign_eof\fR have been
  932. given), and neither of \fB\-adv\fR or \fB\-nocommands\fR are given then "Basic" command
  933. mode is entered. In this mode certain commands are recognized which perform
  934. special operations. These commands are a letter which must appear at the start
  935. of a line. All further data after the initial letter on the line is ignored.
  936. The commands are listed below.
  937. .IP \fBQ\fR 4
  938. .IX Item "Q"
  939. End the current SSL connection and exit.
  940. .IP \fBR\fR 4
  941. .IX Item "R"
  942. Renegotiate the SSL session (TLSv1.2 and below only).
  943. .IP \fBC\fR 4
  944. .IX Item "C"
  945. Attempt to reconnect to the server using a resumption handshake.
  946. .IP \fBk\fR 4
  947. .IX Item "k"
  948. Send a key update message to the server (TLSv1.3 only)
  949. .IP \fBK\fR 4
  950. .IX Item "K"
  951. Send a key update message to the server and request one back (TLSv1.3 only)
  952. .SH "CONNECTED COMMANDS (ADVANCED)"
  953. .IX Header "CONNECTED COMMANDS (ADVANCED)"
  954. If \fB\-adv\fR has been given then "advanced" command mode is entered. As with basic
  955. mode, if a connection is established with an SSL/TLS server then any data
  956. received from the server is displayed and any key presses will be sent to the
  957. server. If end of file is reached then the connection will be closed down.
  958. .PP
  959. Special commands can be supplied by enclosing them in braces, e.g. "{help}" or
  960. "{quit}". These commands can appear anywhere in the text entered into s_client,
  961. but they are not sent to the server. Some commands can take an argument by
  962. ending the command name with ":" and then providing the argument, e.g.
  963. "{keyup:req}". Some commands are only available when certain protocol versions
  964. have been negotiated.
  965. .PP
  966. If a newline appears at the end of a line entered into s_client then this is
  967. also sent to the server. If a command appears on a line on its own with no other
  968. text on the same line, then the newline is suppressed and not sent to the
  969. server.
  970. .PP
  971. The following commands are recognised.
  972. .IP \fBhelp\fR 4
  973. .IX Item "help"
  974. Prints out summary help text about the available commands.
  975. .IP \fBquit\fR 4
  976. .IX Item "quit"
  977. Close the connection to the peer
  978. .IP \fBreconnect\fR 4
  979. .IX Item "reconnect"
  980. Reconnect to the peer and attempt a resumption handshake
  981. .IP \fBkeyup\fR 4
  982. .IX Item "keyup"
  983. Send a Key Update message. TLSv1.3 only. This command takes an optional
  984. argument. If the argument "req" is supplied then the peer is also requested to
  985. update its keys. Otherwise if "noreq" is supplied the peer is not requested
  986. to update its keys. The default is "req".
  987. .IP \fBreneg\fR 4
  988. .IX Item "reneg"
  989. Initiate a renegotiation with the server. (D)TLSv1.2 or below only.
  990. .IP \fBfin\fR 4
  991. .IX Item "fin"
  992. Indicate FIN on the current stream. QUIC only. Once FIN has been sent any
  993. further text entered for this stream is ignored.
  994. .SH NOTES
  995. .IX Header "NOTES"
  996. This command can be used to debug SSL servers. To connect to an SSL HTTP
  997. server the command:
  998. .PP
  999. .Vb 1
  1000. \& openssl s_client \-connect servername:443
  1001. .Ve
  1002. .PP
  1003. would typically be used (https uses port 443). If the connection succeeds
  1004. then an HTTP command can be given such as "GET /" to retrieve a web page.
  1005. .PP
  1006. If the handshake fails then there are several possible causes, if it is
  1007. nothing obvious like no client certificate then the \fB\-bugs\fR,
  1008. \&\fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR options can be tried
  1009. in case it is a buggy server. In particular you should play with these
  1010. options \fBbefore\fR submitting a bug report to an OpenSSL mailing list.
  1011. .PP
  1012. A frequent problem when attempting to get client certificates working
  1013. is that a web client complains it has no certificates or gives an empty
  1014. list to choose from. This is normally because the server is not sending
  1015. the clients certificate authority in its "acceptable CA list" when it
  1016. requests a certificate. By using this command, the CA list can be viewed
  1017. and checked. However, some servers only request client authentication
  1018. after a specific URL is requested. To obtain the list in this case it
  1019. is necessary to use the \fB\-prexit\fR option and send an HTTP request
  1020. for an appropriate page.
  1021. .PP
  1022. If a certificate is specified on the command line using the \fB\-cert\fR
  1023. option it will not be used unless the server specifically requests
  1024. a client certificate. Therefore, merely including a client certificate
  1025. on the command line is no guarantee that the certificate works.
  1026. .PP
  1027. If there are problems verifying a server certificate then the
  1028. \&\fB\-showcerts\fR option can be used to show all the certificates sent by the
  1029. server.
  1030. .PP
  1031. This command is a test tool and is designed to continue the
  1032. handshake after any certificate verification errors. As a result it will
  1033. accept any certificate chain (trusted or not) sent by the peer. Non-test
  1034. applications should \fBnot\fR do this as it makes them vulnerable to a MITM
  1035. attack. This behaviour can be changed by with the \fB\-verify_return_error\fR
  1036. option: any verify errors are then returned aborting the handshake.
  1037. .PP
  1038. The \fB\-bind\fR option may be useful if the server or a firewall requires
  1039. connections to come from some particular address and or port.
  1040. .SS "Note on Non-Interactive Use"
  1041. .IX Subsection "Note on Non-Interactive Use"
  1042. When \fBs_client\fR is run in a non-interactive environment (e.g., a cron job or
  1043. a script without a valid \fIstdin\fR), it may close the connection prematurely,
  1044. especially with TLS 1.3. To prevent this, you can use the \fB\-ign_eof\fR flag,
  1045. which keeps \fBs_client\fR running even after reaching EOF from \fIstdin\fR.
  1046. .PP
  1047. For example:
  1048. .PP
  1049. .Vb 3
  1050. \& openssl s_client \-connect <server address>:443 \-tls1_3
  1051. \& \-sess_out /path/to/tls_session_params_file
  1052. \& \-ign_eof </dev/null
  1053. .Ve
  1054. .PP
  1055. However, relying solely on \fB\-ign_eof\fR can lead to issues if the server keeps
  1056. the connection open, expecting the client to close first. In such cases, the
  1057. client may hang indefinitely. This behavior is not uncommon, particularly with
  1058. protocols where the server waits for a graceful disconnect from the client.
  1059. .PP
  1060. For example, when connecting to an SMTP server, the session may pause if the
  1061. server expects a QUIT command before closing:
  1062. .PP
  1063. .Vb 8
  1064. \& $ openssl s_client \-brief \-ign_eof \-starttls smtp
  1065. \& \-connect <server address>:25 </dev/null
  1066. \& CONNECTION ESTABLISHED
  1067. \& Protocol version: TLSv1.3
  1068. \& Ciphersuite: TLS_AES_256_GCM_SHA384
  1069. \& ...
  1070. \& 250 CHUNKING
  1071. \& [long pause]
  1072. .Ve
  1073. .PP
  1074. To avoid such hangs, it's better to use an application-level command to
  1075. initiate a clean disconnect. For SMTP, you can send a QUIT command:
  1076. .PP
  1077. .Vb 2
  1078. \& printf \*(AqQUIT\er\en\*(Aq | openssl s_client \-connect <server address>:25
  1079. \& \-starttls smtp \-brief \-ign_eof
  1080. .Ve
  1081. .PP
  1082. Similarly, for HTTP/1.1 connections, including a `Connection: close` header
  1083. ensures the server closes the connection after responding:
  1084. .PP
  1085. .Vb 2
  1086. \& printf \*(AqGET / HTTP/1.1\er\enHost: <server address>\er\enConnection: close\er\en\er\en\*(Aq
  1087. \& | openssl s_client \-connect <server address>:443 \-brief
  1088. .Ve
  1089. .PP
  1090. These approaches help manage the connection closure gracefully and prevent
  1091. hangs caused by the server waiting for the client to initiate the disconnect.
  1092. .SH BUGS
  1093. .IX Header "BUGS"
  1094. Because this program has a lot of options and also because some of the
  1095. techniques used are rather old, the C source for this command is rather
  1096. hard to read and not a model of how things should be done.
  1097. A typical SSL client program would be much simpler.
  1098. .PP
  1099. The \fB\-prexit\fR option is a bit of a hack. We should really report
  1100. information whenever a session is renegotiated.
  1101. .SH "SEE ALSO"
  1102. .IX Header "SEE ALSO"
  1103. \&\fBopenssl\fR\|(1),
  1104. \&\fBopenssl\-sess_id\fR\|(1),
  1105. \&\fBopenssl\-s_server\fR\|(1),
  1106. \&\fBopenssl\-ciphers\fR\|(1),
  1107. \&\fBSSL_CONF_cmd\fR\|(3),
  1108. \&\fBSSL_CTX_set_max_send_fragment\fR\|(3),
  1109. \&\fBSSL_CTX_set_split_send_fragment\fR\|(3),
  1110. \&\fBSSL_CTX_set_max_pipelines\fR\|(3),
  1111. \&\fBossl_store\-file\fR\|(7)
  1112. .SH HISTORY
  1113. .IX Header "HISTORY"
  1114. The \fB\-no_alt_chains\fR option was added in OpenSSL 1.1.0.
  1115. The \fB\-name\fR option was added in OpenSSL 1.1.1.
  1116. .PP
  1117. The \fB\-certform\fR option has become obsolete in OpenSSL 3.0.0 and has no effect.
  1118. .PP
  1119. The \fB\-engine\fR option was deprecated in OpenSSL 3.0.
  1120. .PP
  1121. The
  1122. \&\fB\-enable_client_rpk\fR,
  1123. \&\fB\-enable_server_rpk\fR,
  1124. \&\fB\-no_rx_cert_comp\fR,
  1125. \&\fB\-no_tx_cert_comp\fR,
  1126. and \fB\-tfo\fR
  1127. options were added in OpenSSL 3.2.
  1128. .SH COPYRIGHT
  1129. .IX Header "COPYRIGHT"
  1130. Copyright 2000\-2024 The OpenSSL Project Authors. All Rights Reserved.
  1131. .PP
  1132. Licensed under the Apache License 2.0 (the "License"). You may not use
  1133. this file except in compliance with the License. You can obtain a copy
  1134. in the file LICENSE in the source distribution or at
  1135. <https://www.openssl.org/source/license.html>.