summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2016-09-01 08:26:44 +0000
committerjmc <>2016-09-01 08:26:44 +0000
commit29691310a3ac3c03344011aed5df5a4a0cb892e3 (patch)
tree8d73d2620022b2ec34aef1c239a3b7dfd440ac62 /src
parent1f7abdf5a5dbb8be23c2a3f07bd7e812d2f2a8b8 (diff)
downloadopenbsd-29691310a3ac3c03344011aed5df5a4a0cb892e3.tar.gz
openbsd-29691310a3ac3c03344011aed5df5a4a0cb892e3.tar.bz2
openbsd-29691310a3ac3c03344011aed5df5a4a0cb892e3.zip
shorten s_client;
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.1192
1 files changed, 50 insertions, 142 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index e4732394d0..ad68095950 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.65 2016/08/30 07:53:59 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.66 2016/09/01 08:26:44 jmc Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -112,7 +112,7 @@
112.\" 112.\"
113.\" OPENSSL 113.\" OPENSSL
114.\" 114.\"
115.Dd $Mdocdate: August 30 2016 $ 115.Dd $Mdocdate: September 1 2016 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -2694,13 +2694,13 @@ The
2694.Fl keysig 2694.Fl keysig
2695option marks the key for signing only. 2695option marks the key for signing only.
2696Signing only keys can be used for S/MIME signing, authenticode 2696Signing only keys can be used for S/MIME signing, authenticode
2697.Pq ActiveX control signing 2697(ActiveX control signing)
2698and SSL client authentication. 2698and SSL client authentication.
2699.It Fl macalg Ar alg 2699.It Fl macalg Ar alg
2700Specify the MAC digest algorithm. 2700Specify the MAC digest algorithm.
2701The default is SHA1. 2701The default is SHA1.
2702.It Fl maciter 2702.It Fl maciter
2703Included for compatability only: 2703Included for compatibility only:
2704it used to be needed to use MAC iterations counts 2704it used to be needed to use MAC iterations counts
2705but they are now used by default. 2705but they are now used by default.
2706.It Fl name Ar name 2706.It Fl name Ar name
@@ -3612,13 +3612,9 @@ This requires an RSA private key.
3612.It Fl verify 3612.It Fl verify
3613Verify the input data and output the recovered data. 3613Verify the input data and output the recovered data.
3614.El 3614.El
3615.\"
3616.\" S_CLIENT
3617.\"
3618.Sh S_CLIENT 3615.Sh S_CLIENT
3619.nr nS 1 3616.nr nS 1
3620.Nm "openssl s_client" 3617.Nm "openssl s_client"
3621.Bk -words
3622.Op Fl 4 | 6 3618.Op Fl 4 | 6
3623.Op Fl bugs 3619.Op Fl bugs
3624.Op Fl CAfile Ar file 3620.Op Fl CAfile Ar file
@@ -3626,10 +3622,7 @@ Verify the input data and output the recovered data.
3626.Op Fl cert Ar file 3622.Op Fl cert Ar file
3627.Op Fl check_ss_sig 3623.Op Fl check_ss_sig
3628.Op Fl cipher Ar cipherlist 3624.Op Fl cipher Ar cipherlist
3629.Oo 3625.Op Fl connect Ar host Ns Op : Ns Ar port
3630.Fl connect Ar host : Ns Ar port |
3631.Ar host Ns / Ns Ar port
3632.Oc
3633.Op Fl crl_check 3626.Op Fl crl_check
3634.Op Fl crl_check_all 3627.Op Fl crl_check_all
3635.Op Fl crlf 3628.Op Fl crlf
@@ -3665,30 +3658,34 @@ Verify the input data and output the recovered data.
3665.Op Fl verify Ar depth 3658.Op Fl verify Ar depth
3666.Op Fl x509_strict 3659.Op Fl x509_strict
3667.Op Fl xmpphost Ar host 3660.Op Fl xmpphost Ar host
3668.Ek
3669.nr nS 0 3661.nr nS 0
3670.Pp 3662.Pp
3671The 3663The
3672.Nm s_client 3664.Nm s_client
3673command implements a generic SSL/TLS client which connects 3665command implements a generic SSL/TLS client which connects
3674to a remote host using SSL/TLS. 3666to a remote host using SSL/TLS.
3675It is a 3667.Pp
3676.Em very 3668If a connection is established with an SSL server, any data received
3677useful diagnostic tool for SSL servers. 3669from the server is displayed and any key presses will be sent to the
3670server.
3671When used interactively (which means neither
3672.Fl quiet
3673nor
3674.Fl ign_eof
3675have been given), the session will be renegotiated if the line begins with an
3676.Cm R ;
3677if the line begins with a
3678.Cm Q
3679or if end of file is reached, the connection will be closed down.
3678.Pp 3680.Pp
3679The options are as follows: 3681The options are as follows:
3680.Bl -tag -width Ds 3682.Bl -tag -width Ds
3681.It Fl 4 3683.It Fl 4
3682Specify that 3684Attempt connections using IPv4 only.
3683.Nm s_client
3684should attempt connections using IPv4 only.
3685.It Fl 6 3685.It Fl 6
3686Specify that 3686Attempt connections using IPv6 only.
3687.Nm s_client
3688should attempt connections using IPv6 only.
3689.It Fl bugs 3687.It Fl bugs
3690There are several known bugs in SSL and TLS implementations. 3688Enable various workarounds for buggy implementations.
3691Adding this option enables various workarounds.
3692.It Fl CAfile Ar file 3689.It Fl CAfile Ar file
3693A 3690A
3694.Ar file 3691.Ar file
@@ -3719,57 +3716,48 @@ The default is not to use a certificate.
3719.Xc 3716.Xc
3720Set various certificate chain validation options. 3717Set various certificate chain validation options.
3721See the 3718See the
3722.Nm VERIFY 3719.Nm verify
3723command for details. 3720command for details.
3724.It Fl cipher Ar cipherlist 3721.It Fl cipher Ar cipherlist
3725This allows the cipher list sent by the client to be modified. 3722Modify the cipher list sent by the client.
3726Although the server determines which cipher suite is used, it should take 3723Although the server determines which cipher suite is used, it should take
3727the first supported cipher in the list sent by the client. 3724the first supported cipher in the list sent by the client.
3728See the 3725See the
3729.Sx CIPHERS 3726.Nm ciphers
3730section above for more information. 3727command for more information.
3731.It Xo 3728.It Fl connect Ar host Ns Op : Ns Ar port
3732.Fl connect Ar host : Ns Ar port | 3729The
3733.Ar host Ns / Ns Ar port
3734.Xc
3735This specifies the
3736.Ar host 3730.Ar host
3737and optional 3731and
3738.Ar port 3732.Ar port
3739to connect to. 3733to connect to.
3740If not specified, an attempt is made to connect to the local host 3734If not specified, an attempt is made to connect to the local host
3741on port 4433. 3735on port 4433.
3742Alternatively, the host and port pair may be separated using a forward-slash 3736Alternatively, the host and port pair may be separated using a forward-slash
3743character. 3737character,
3744This form is useful for numeric IPv6 addresses. 3738which is useful for numeric IPv6 addresses.
3745.It Fl crlf 3739.It Fl crlf
3746This option translates a line feed from the terminal into CR+LF as required 3740Translate a line feed from the terminal into CR+LF,
3747by some servers. 3741as required by some servers.
3748.It Fl debug 3742.It Fl debug
3749Print extensive debugging information including a hex dump of all traffic. 3743Print extensive debugging information, including a hex dump of all traffic.
3750.It Fl ign_eof 3744.It Fl ign_eof
3751Inhibit shutting down the connection when end of file is reached in the 3745Inhibit shutting down the connection when end of file is reached in the input.
3752input.
3753.It Fl key Ar keyfile 3746.It Fl key Ar keyfile
3754The private key to use. 3747The private key to use.
3755If not specified, the certificate file will be used. 3748If not specified, the certificate file will be used.
3756.It Fl msg 3749.It Fl msg
3757Show all protocol messages with hex dump. 3750Show all protocol messages with hex dump.
3758.It Fl nbio 3751.It Fl nbio
3759Turns on non-blocking I/O. 3752Turn on non-blocking I/O.
3760.It Fl nbio_test 3753.It Fl nbio_test
3761Tests non-blocking I/O. 3754Test non-blocking I/O.
3762.It Fl no_tls1 | no_tls1_1 | no_tls1_2 3755.It Fl no_tls1 | no_tls1_1 | no_tls1_2
3763By default, the initial handshake uses a method which should be compatible 3756Disable the use of TLS1.0, 1.1, and 1.2, respectively.
3764with servers supporting any version of TLS.
3765These options disable the use of TLS1.0, 1.1, and 1.2, respectively.
3766.Pp
3767Unfortunately there are a lot of ancient and broken servers in use which
3768cannot handle this technique and will fail to connect.
3769.It Fl no_ticket 3757.It Fl no_ticket
3770Disable RFC 4507 session ticket support. 3758Disable RFC 4507 session ticket support.
3771.It Fl pause 3759.It Fl pause
3772Pauses 1 second between each read and write call. 3760Pause 1 second between each read and write call.
3773.It Fl prexit 3761.It Fl prexit
3774Print session information when the program exits. 3762Print session information when the program exits.
3775This will always attempt 3763This will always attempt
@@ -3778,9 +3766,8 @@ Normally, information will only be printed out once if the connection succeeds.
3778This option is useful because the cipher in use may be renegotiated 3766This option is useful because the cipher in use may be renegotiated
3779or the connection may fail because a client certificate is required or is 3767or the connection may fail because a client certificate is required or is
3780requested only after an attempt is made to access a certain URL. 3768requested only after an attempt is made to access a certain URL.
3781.Sy Note : 3769Note that the output produced by this option is not always accurate
3782the output produced by this option is not always accurate because a 3770because a connection might never have been established.
3783connection might never have been established.
3784.It Fl proxy Ar host : Ns Ar port 3771.It Fl proxy Ar host : Ns Ar port
3785Use the HTTP proxy at 3772Use the HTTP proxy at
3786.Ar host 3773.Ar host
@@ -3799,7 +3786,7 @@ when using a PSK cipher suite.
3799The key is given as a hexadecimal number without the leading 0x, 3786The key is given as a hexadecimal number without the leading 0x,
3800for example -psk 1a2b3c4d. 3787for example -psk 1a2b3c4d.
3801.It Fl psk_identity Ar identity 3788.It Fl psk_identity Ar identity
3802Use the PSK identity 3789Use the PSK
3803.Ar identity 3790.Ar identity
3804when using a PSK cipher suite. 3791when using a PSK cipher suite.
3805.It Fl quiet 3792.It Fl quiet
@@ -3808,7 +3795,7 @@ This implicitly turns on
3808.Fl ign_eof 3795.Fl ign_eof
3809as well. 3796as well.
3810.It Fl reconnect 3797.It Fl reconnect
3811Reconnects to the same server 5 times using the same session ID; this can 3798Reconnect to the same server 5 times using the same session ID; this can
3812be used as a test that session caching is working. 3799be used as a test that session caching is working.
3813.It Fl servername Ar name 3800.It Fl servername Ar name
3814Include the TLS Server Name Indication (SNI) extension in the ClientHello 3801Include the TLS Server Name Indication (SNI) extension in the ClientHello
@@ -3818,7 +3805,7 @@ message, using the specified server
3818Display the whole server certificate chain: normally only the server 3805Display the whole server certificate chain: normally only the server
3819certificate itself is displayed. 3806certificate itself is displayed.
3820.It Fl starttls Ar protocol 3807.It Fl starttls Ar protocol
3821Send the protocol-specific message(s) to switch to TLS for communication. 3808Send the protocol-specific messages to switch to TLS for communication.
3822.Ar protocol 3809.Ar protocol
3823is a keyword for the intended protocol. 3810is a keyword for the intended protocol.
3824Currently, the supported keywords are 3811Currently, the supported keywords are
@@ -3829,106 +3816,27 @@ Currently, the supported keywords are
3829and 3816and
3830.Qq xmpp . 3817.Qq xmpp .
3831.It Fl state 3818.It Fl state
3832Prints out the SSL session states. 3819Print the SSL session states.
3833.It Fl tls1 | tls1_1 | tls1_2 3820.It Fl tls1 | tls1_1 | tls1_2
3834Permit only TLS1.0, 1.1, or 1.2, respectively. 3821Permit only TLS1.0, 1.1, or 1.2, respectively.
3835.It Fl tlsextdebug 3822.It Fl tlsextdebug
3836Print out a hex dump of any TLS extensions received from the server. 3823Print a hex dump of any TLS extensions received from the server.
3837.It Fl verify Ar depth 3824.It Fl verify Ar depth
3838The verify 3825Turn on server certificate verification,
3839.Ar depth 3826with a maximum length of
3840to use. 3827.Ar depth .
3841This specifies the maximum length of the
3842server certificate chain and turns on server certificate verification.
3843Currently the verify operation continues after errors so all the problems 3828Currently the verify operation continues after errors so all the problems
3844with a certificate chain can be seen. 3829with a certificate chain can be seen.
3845As a side effect the connection will never fail due to a server 3830As a side effect the connection will never fail due to a server
3846certificate verify failure. 3831certificate verify failure.
3847.It Fl xmpphost Ar hostname 3832.It Fl xmpphost Ar hostname
3848This option, when used with 3833When used with
3849.Fl starttls Ar xmpp , 3834.Fl starttls Ar xmpp ,
3850specifies the host for the "to" attribute of the stream element. 3835specify the host for the "to" attribute of the stream element.
3851If this option is not specified then the host specified with 3836If this option is not specified then the host specified with
3852.Fl connect 3837.Fl connect
3853will be used. 3838will be used.
3854.El 3839.El
3855.Sh S_CLIENT CONNECTED COMMANDS
3856If a connection is established with an SSL server, any data received
3857from the server is displayed and any key presses will be sent to the
3858server.
3859When used interactively (which means neither
3860.Fl quiet
3861nor
3862.Fl ign_eof
3863have been given), the session will be renegotiated if the line begins with an
3864.Em R ;
3865if the line begins with a
3866.Em Q
3867or if end of file is reached, the connection will be closed down.
3868.Sh S_CLIENT NOTES
3869.Nm s_client
3870can be used to debug SSL servers.
3871To connect to an SSL HTTP server the command:
3872.Pp
3873.Dl $ openssl s_client -connect servername:443
3874.Pp
3875would typically be used
3876.Pq HTTPS uses port 443 .
3877If the connection succeeds, an HTTP command can be given such as
3878.Qq GET
3879to retrieve a web page.
3880.Pp
3881If the handshake fails, there are several possible causes; if it is
3882nothing obvious like no client certificate, then the
3883.Fl bugs , tls1 , tls1_1, tls1_2 , no_tls1 , no_tls1_1 ,
3884and
3885.Fl no_tls1_2
3886options can be tried in case it is a buggy server.
3887.Pp
3888A frequent problem when attempting to get client certificates working
3889is that a web client complains it has no certificates or gives an empty
3890list to choose from.
3891This is normally because the server is not sending the client's certificate
3892authority in its
3893.Qq acceptable CA list
3894when it requests a certificate.
3895By using
3896.Nm s_client
3897the CA list can be viewed and checked.
3898However some servers only request client authentication
3899after a specific URL is requested.
3900To obtain the list in this case it is necessary to use the
3901.Fl prexit
3902option and send an HTTP request for an appropriate page.
3903.Pp
3904If a certificate is specified on the command line using the
3905.Fl cert
3906option, it will not be used unless the server specifically requests
3907a client certificate.
3908Therefore merely including a client certificate
3909on the command line is no guarantee that the certificate works.
3910.Pp
3911If there are problems verifying a server certificate, the
3912.Fl showcerts
3913option can be used to show the whole chain.
3914.Pp
3915Compression methods are only supported for
3916.Fl tls1 .
3917.Sh S_CLIENT BUGS
3918Because this program has a lot of options and also because some of
3919the techniques used are rather old, the C source of
3920.Nm s_client
3921is rather hard to read and not a model of how things should be done.
3922A typical SSL client program would be much simpler.
3923.Pp
3924The
3925.Fl verify
3926option should really exit if the server verification fails.
3927.Pp
3928The
3929.Fl prexit
3930option is a bit of a hack.
3931We should really report information whenever a session is renegotiated.
3932.\" 3840.\"
3933.\" S_SERVER 3841.\" S_SERVER
3934.\" 3842.\"