summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2016-09-02 18:43:52 +0000
committerjmc <>2016-09-02 18:43:52 +0000
commitb31711d05313b5cda9eade326e32e2e41369ac17 (patch)
tree940d3e71768a20543f91e951918e00e54a08554f /src
parentc316085e40bc88a23e887823b4e2e5049df2a2c8 (diff)
downloadopenbsd-b31711d05313b5cda9eade326e32e2e41369ac17.tar.gz
openbsd-b31711d05313b5cda9eade326e32e2e41369ac17.tar.bz2
openbsd-b31711d05313b5cda9eade326e32e2e41369ac17.zip
shorten s_server;
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.1206
1 files changed, 72 insertions, 134 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index ad68095950..d6a5ca6601 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.66 2016/09/01 08:26:44 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.67 2016/09/02 18:43:52 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: September 1 2016 $ 115.Dd $Mdocdate: September 2 2016 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -3837,13 +3837,9 @@ If this option is not specified then the host specified with
3837.Fl connect 3837.Fl connect
3838will be used. 3838will be used.
3839.El 3839.El
3840.\"
3841.\" S_SERVER
3842.\"
3843.Sh S_SERVER 3840.Sh S_SERVER
3844.nr nS 1 3841.nr nS 1
3845.Nm "openssl s_server" 3842.Nm "openssl s_server"
3846.Bk -words
3847.Op Fl accept Ar port 3843.Op Fl accept Ar port
3848.Op Fl bugs 3844.Op Fl bugs
3849.Op Fl CAfile Ar file 3845.Op Fl CAfile Ar file
@@ -3883,7 +3879,6 @@ will be used.
3883.Op Fl verify Ar depth 3879.Op Fl verify Ar depth
3884.Op Fl WWW 3880.Op Fl WWW
3885.Op Fl www 3881.Op Fl www
3886.Ek
3887.nr nS 0 3882.nr nS 0
3888.Pp 3883.Pp
3889The 3884The
@@ -3891,18 +3886,42 @@ The
3891command implements a generic SSL/TLS server which listens 3886command implements a generic SSL/TLS server which listens
3892for connections on a given port using SSL/TLS. 3887for connections on a given port using SSL/TLS.
3893.Pp 3888.Pp
3889If a connection request is established with a client and neither the
3890.Fl www
3891nor the
3892.Fl WWW
3893option has been used, then any data received
3894from the client is displayed and any key presses are sent to the client.
3895Certain single letter commands perform special operations:
3896.Pp
3897.Bl -tag -width "XXXX" -compact
3898.It Ic P
3899Send plain text, which should cause the client to disconnect.
3900.It Ic Q
3901End the current SSL connection and exit.
3902.It Ic q
3903End the current SSL connection, but still accept new connections.
3904.It Ic R
3905Renegotiate the SSL session and request a client certificate.
3906.It Ic r
3907Renegotiate the SSL session.
3908.It Ic S
3909Print out some session cache status information.
3910.El
3911.Pp
3894The options are as follows: 3912The options are as follows:
3895.Bl -tag -width Ds 3913.Bl -tag -width Ds
3896.It Fl accept Ar port 3914.It Fl accept Ar port
3897The TCP 3915Listen on TCP
3898.Ar port 3916.Ar port
3899to listen on for connections. 3917for connections.
3900If not specified, 4433 is used. 3918The default is port 4433.
3901.It Fl bugs 3919.It Fl bugs
3902There are several known bugs in SSL and TLS implementations. 3920Enable various workarounds for buggy implementations.
3903Adding this option enables various workarounds.
3904.It Fl CAfile Ar file 3921.It Fl CAfile Ar file
3905A file containing trusted certificates to use during client authentication 3922A
3923.Ar file
3924containing trusted certificates to use during client authentication
3906and to use when attempting to build the server certificate chain. 3925and to use when attempting to build the server certificate chain.
3907The list is also used in the list of acceptable client CAs passed to the 3926The list is also used in the list of acceptable client CAs passed to the
3908client when a certificate is requested. 3927client when a certificate is requested.
@@ -3917,35 +3936,33 @@ see
3917for more information. 3936for more information.
3918These are also used when building the server certificate chain. 3937These are also used when building the server certificate chain.
3919.It Fl cert Ar file 3938.It Fl cert Ar file
3920The certificate to use; most server's cipher suites require the use of a 3939The certificate to use: most server's cipher suites require the use of a
3921certificate and some require a certificate with a certain public key type: 3940certificate and some require a certificate with a certain public key type.
3922for example the DSS cipher suites require a certificate containing a DSS 3941For example, the DSS cipher suites require a certificate containing a DSS
3923.Pq DSA 3942(DSA) key.
3924key.
3925If not specified, the file 3943If not specified, the file
3926.Pa server.pem 3944.Pa server.pem
3927will be used. 3945will be used.
3928.It Fl cipher Ar cipherlist 3946.It Fl cipher Ar cipherlist
3947Modify the cipher list used by the server.
3929This allows the cipher list used by the server to be modified. 3948This allows the cipher list used by the server to be modified.
3930When the client sends a list of supported ciphers, the first client cipher 3949When the client sends a list of supported ciphers, the first client cipher
3931also included in the server list is used. 3950also included in the server list is used.
3932Because the client specifies the preference order, the order of the server 3951Because the client specifies the preference order, the order of the server
3933cipherlist is irrelevant. 3952cipherlist is irrelevant.
3934See the 3953See the
3935.Sx CIPHERS 3954.Nm ciphers
3936section for more information. 3955command for more information.
3937.It Fl context Ar id 3956.It Fl context Ar id
3938Sets the SSL context ID. 3957Set the SSL context ID.
3939It can be given any string value. 3958It can be given any string value.
3940If this option is not present, a default value will be used.
3941.It Fl crl_check , crl_check_all 3959.It Fl crl_check , crl_check_all
3942Check the peer certificate has not been revoked by its CA. 3960Check the peer certificate has not been revoked by its CA.
3943The CRLs are appended to the certificate file. 3961The CRLs are appended to the certificate file.
3944With the
3945.Fl crl_check_all 3962.Fl crl_check_all
3946option, all CRLs of all CAs in the chain are checked. 3963checks all CRLs of all CAs in the chain.
3947.It Fl crlf 3964.It Fl crlf
3948This option translates a line feed from the terminal into CR+LF. 3965Translate a line feed from the terminal into CR+LF.
3949.It Fl dcert Ar file , Fl dkey Ar file 3966.It Fl dcert Ar file , Fl dkey Ar file
3950Specify an additional certificate and private key; these behave in the 3967Specify an additional certificate and private key; these behave in the
3951same manner as the 3968same manner as the
@@ -3953,18 +3970,12 @@ same manner as the
3953and 3970and
3954.Fl key 3971.Fl key
3955options except there is no default if they are not specified 3972options except there is no default if they are not specified
3956.Pq no additional certificate or key is used . 3973(no additional certificate or key is used).
3957As noted above some cipher suites require a certificate containing a key of
3958a certain type.
3959Some cipher suites need a certificate carrying an RSA key
3960and some a DSS
3961.Pq DSA
3962key.
3963By using RSA and DSS certificates and keys, 3974By using RSA and DSS certificates and keys,
3964a server can support clients which only support RSA or DSS cipher suites 3975a server can support clients which only support RSA or DSS cipher suites
3965by using an appropriate certificate. 3976by using an appropriate certificate.
3966.It Fl debug 3977.It Fl debug
3967Print extensive debugging information including a hex dump of all traffic. 3978Print extensive debugging information, including a hex dump of all traffic.
3968.It Fl dhparam Ar file 3979.It Fl dhparam Ar file
3969The DH parameter file to use. 3980The DH parameter file to use.
3970The ephemeral DH cipher suites generate keys 3981The ephemeral DH cipher suites generate keys
@@ -3975,13 +3986,11 @@ If this fails, a static set of parameters hard coded into the
3975.Nm s_server 3986.Nm s_server
3976program will be used. 3987program will be used.
3977.It Fl hack 3988.It Fl hack
3978This option enables a further workaround for some early Netscape 3989Enables a further workaround for some early Netscape SSL code.
3979SSL code
3980.Pq \&? .
3981.It Fl HTTP 3990.It Fl HTTP
3982Emulates a simple web server. 3991Emulate a simple web server.
3983Pages will be resolved relative to the current directory; 3992Pages are resolved relative to the current directory.
3984for example if the URL 3993For example if the URL
3985.Pa https://myhost/page.html 3994.Pa https://myhost/page.html
3986is requested, the file 3995is requested, the file
3987.Pa ./page.html 3996.Pa ./page.html
@@ -3993,33 +4002,29 @@ must end with CRLF).
3993Generate SSL/TLS session IDs prefixed by 4002Generate SSL/TLS session IDs prefixed by
3994.Ar arg . 4003.Ar arg .
3995This is mostly useful for testing any SSL/TLS code 4004This is mostly useful for testing any SSL/TLS code
3996.Pq e.g. proxies 4005(e.g. proxies)
3997that wish to deal with multiple servers, when each of which might be 4006that wish to deal with multiple servers, when each of which might be
3998generating a unique range of session IDs 4007generating a unique range of session IDs
3999.Pq e.g. with a certain prefix . 4008(e.g. with a certain prefix).
4000.It Fl key Ar keyfile 4009.It Fl key Ar keyfile
4001The private key to use. 4010The private key to use.
4002If not specified, the certificate file will be used. 4011If not specified, the certificate file will be used.
4003.It Fl msg 4012.It Fl msg
4004Show all protocol messages with hex dump. 4013Show all protocol messages with hex dump.
4005.It Fl nbio 4014.It Fl nbio
4006Turns on non-blocking I/O. 4015Turn on non-blocking I/O.
4007.It Fl nbio_test 4016.It Fl nbio_test
4008Tests non-blocking I/O. 4017Test non-blocking I/O.
4009.It Fl no_dhe 4018.It Fl no_dhe
4010If this option is set, no DH parameters will be loaded, effectively 4019Disable ephemeral DH cipher suites.
4011disabling the ephemeral DH cipher suites.
4012.It Fl no_tls1 | no_tls1_1 | no_tls1_2 4020.It Fl no_tls1 | no_tls1_1 | no_tls1_2
4013By default, the initial handshake uses a method which should be compatible 4021Disable the use of TLS1.0, 1.1, and 1.2, respectively.
4014with clients supporting any version of TLS.
4015These options disable the use of TLS1.0, 1.1, and 1.2, respectively.
4016.It Fl no_tmp_rsa 4022.It Fl no_tmp_rsa
4017Certain export cipher suites sometimes use a temporary RSA key; this option 4023Disable temporary RSA key generation.
4018disables temporary RSA key generation.
4019.It Fl nocert 4024.It Fl nocert
4020If this option is set, no certificate is used. 4025Do not use a certificate.
4021This restricts the cipher suites available to the anonymous ones 4026This restricts the cipher suites available to the anonymous ones
4022.Pq currently just anonymous DH . 4027(currently just anonymous DH).
4023.It Fl psk Ar key 4028.It Fl psk Ar key
4024Use the PSK key 4029Use the PSK key
4025.Ar key 4030.Ar key
@@ -4035,100 +4040,33 @@ Inhibit printing of session and certificate information.
4035.It Fl serverpref 4040.It Fl serverpref
4036Use server's cipher preferences. 4041Use server's cipher preferences.
4037.It Fl state 4042.It Fl state
4038Prints out the SSL session states. 4043Print the SSL session states.
4039.It Fl tls1 | tls1_1 | tls1_2 4044.It Fl tls1 | tls1_1 | tls1_2
4040Permit only TLS1.0, 1.1, or 1.2, respectively. 4045Permit only TLS1.0, 1.1, or 1.2, respectively.
4041.It Fl WWW 4046.It Fl WWW
4042Emulates a simple web server. 4047Emulate a simple web server.
4043Pages will be resolved relative to the current directory; 4048Pages are resolved relative to the current directory.
4044for example if the URL 4049For example if the URL
4045.Pa https://myhost/page.html 4050.Pa https://myhost/page.html
4046is requested, the file 4051is requested, the file
4047.Pa ./page.html 4052.Pa ./page.html
4048will be loaded. 4053will be loaded.
4049.It Fl www 4054.It Fl www
4050Sends a status message back to the client when it connects. 4055Send a status message to the client when it connects,
4051This includes lots of information about the ciphers used and various 4056including information about the ciphers used and various session parameters.
4052session parameters.
4053The output is in HTML format so this option will normally be used with a 4057The output is in HTML format so this option will normally be used with a
4054web browser. 4058web browser.
4055.It Fl Verify Ar depth , Fl verify Ar depth 4059.It Fl Verify Ar depth , Fl verify Ar depth
4056The verify 4060Request a certificate chain from the client,
4057.Ar depth 4061with a maximum length of
4058to use. 4062.Ar depth .
4059This specifies the maximum length of the client certificate chain 4063With
4060and makes the server request a certificate from the client. 4064.Fl Verify ,
4061With the 4065the client must supply a certificate or an error occurs;
4062.Fl Verify 4066with
4063option, the client must supply a certificate or an error occurs. 4067.Fl verify ,
4064With the 4068a certificate is requested but the client does not have to send one.
4065.Fl verify
4066option, a certificate is requested but the client does not have to send one.
4067.El
4068.Sh S_SERVER CONNECTED COMMANDS
4069If a connection request is established with an SSL client and neither the
4070.Fl www
4071nor the
4072.Fl WWW
4073option has been used, then normally any data received
4074from the client is displayed and any key presses will be sent to the client.
4075.Pp
4076Certain single letter commands are also recognized which perform special
4077operations: these are listed below.
4078.Bl -tag -width "XXXX"
4079.It Ar P
4080Send some plain text down the underlying TCP connection: this should
4081cause the client to disconnect due to a protocol violation.
4082.It Ar Q
4083End the current SSL connection and exit.
4084.It Ar q
4085End the current SSL connection, but still accept new connections.
4086.It Ar R
4087Renegotiate the SSL session and request a client certificate.
4088.It Ar r
4089Renegotiate the SSL session.
4090.It Ar S
4091Print out some session cache status information.
4092.El 4069.El
4093.Sh S_SERVER NOTES
4094.Nm s_server
4095can be used to debug SSL clients.
4096To accept connections from a web browser the command:
4097.Pp
4098.Dl $ openssl s_server -accept 443 -www
4099.Pp
4100can be used, for example.
4101.Pp
4102Most web browsers
4103.Pq in particular Netscape and MSIE
4104only support RSA cipher suites, so they cannot connect to servers
4105which don't use a certificate carrying an RSA key or a version of
4106.Nm OpenSSL
4107with RSA disabled.
4108.Pp
4109Although specifying an empty list of CAs when requesting a client certificate
4110is strictly speaking a protocol violation, some SSL
4111clients interpret this to mean any CA is acceptable.
4112This is useful for debugging purposes.
4113.Pp
4114The session parameters can printed out using the
4115.Nm sess_id
4116program.
4117.Sh S_SERVER BUGS
4118Because this program has a lot of options and also because some of
4119the techniques used are rather old, the C source of
4120.Nm s_server
4121is rather hard to read and not a model of how things should be done.
4122A typical SSL server program would be much simpler.
4123.Pp
4124The output of common ciphers is wrong: it just gives the list of ciphers that
4125.Nm OpenSSL
4126recognizes and the client supports.
4127.Pp
4128There should be a way for the
4129.Nm s_server
4130program to print out details of any
4131unknown cipher suites a client says it supports.
4132.\" 4070.\"
4133.\" S_TIME 4071.\" S_TIME
4134.\" 4072.\"