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