448 lines
13 KiB
Groff
448 lines
13 KiB
Groff
.rn '' }`
|
|
'''
|
|
'''
|
|
.de Sh
|
|
.br
|
|
.if t .Sp
|
|
.ne 5
|
|
.PP
|
|
\fB\\$1\fR
|
|
.PP
|
|
..
|
|
.de Sp
|
|
.if t .sp .5v
|
|
.if n .sp
|
|
..
|
|
.de Ip
|
|
.br
|
|
.ie \\n(.$>=3 .ne \\$3
|
|
.el .ne 3
|
|
.IP "\\$1" \\$2
|
|
..
|
|
.de Vb
|
|
.ft CW
|
|
.nf
|
|
.ne \\$1
|
|
..
|
|
.de Ve
|
|
.ft R
|
|
|
|
.fi
|
|
..
|
|
'''
|
|
'''
|
|
''' Set up \*(-- to give an unbreakable dash;
|
|
''' string Tr holds user defined translation string.
|
|
''' Bell System Logo is used as a dummy character.
|
|
'''
|
|
.tr \(*W-|\(bv\*(Tr
|
|
.ie n \{\
|
|
.ds -- \(*W-
|
|
.ds PI pi
|
|
.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
|
.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
|
.ds L" ""
|
|
.ds R" ""
|
|
''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of
|
|
''' \*(L" and \*(R", except that they are used on ".xx" lines,
|
|
''' such as .IP and .SH, which do another additional levels of
|
|
''' double-quote interpretation
|
|
.ds M" """
|
|
.ds S" """
|
|
.ds N" """""
|
|
.ds T" """""
|
|
.ds L' '
|
|
.ds R' '
|
|
.ds M' '
|
|
.ds S' '
|
|
.ds N' '
|
|
.ds T' '
|
|
'br\}
|
|
.el\{\
|
|
.ds -- \(em\|
|
|
.tr \*(Tr
|
|
.ds L" ``
|
|
.ds R" ''
|
|
.ds M" ``
|
|
.ds S" ''
|
|
.ds N" ``
|
|
.ds T" ''
|
|
.ds L' `
|
|
.ds R' '
|
|
.ds M' `
|
|
.ds S' '
|
|
.ds N' `
|
|
.ds T' '
|
|
.ds PI \(*p
|
|
'br\}
|
|
.\" If the F register is turned on, we'll generate
|
|
.\" index entries out stderr for the following things:
|
|
.\" TH Title
|
|
.\" SH Header
|
|
.\" Sh Subsection
|
|
.\" Ip Item
|
|
.\" X<> Xref (embedded
|
|
.\" Of course, you have to process the output yourself
|
|
.\" in some meaninful fashion.
|
|
.if \nF \{
|
|
.de IX
|
|
.tm Index:\\$1\t\\n%\t"\\$2"
|
|
..
|
|
.nr % 0
|
|
.rr F
|
|
.\}
|
|
.TH S_SERVER 1 "0.9.5a" "22/Jul/2000" "OpenSSL"
|
|
.UC
|
|
.if n .hy 0
|
|
.if n .na
|
|
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
|
.de CQ \" put $1 in typewriter font
|
|
.ft CW
|
|
'if n "\c
|
|
'if t \\&\\$1\c
|
|
'if n \\&\\$1\c
|
|
'if n \&"
|
|
\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
|
|
'.ft R
|
|
..
|
|
.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
|
|
. \" AM - accent mark definitions
|
|
.bd B 3
|
|
. \" fudge factors for nroff and troff
|
|
.if n \{\
|
|
. ds #H 0
|
|
. ds #V .8m
|
|
. ds #F .3m
|
|
. ds #[ \f1
|
|
. ds #] \fP
|
|
.\}
|
|
.if t \{\
|
|
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
|
. ds #V .6m
|
|
. ds #F 0
|
|
. ds #[ \&
|
|
. ds #] \&
|
|
.\}
|
|
. \" simple accents for nroff and troff
|
|
.if n \{\
|
|
. ds ' \&
|
|
. ds ` \&
|
|
. ds ^ \&
|
|
. ds , \&
|
|
. ds ~ ~
|
|
. ds ? ?
|
|
. ds ! !
|
|
. ds /
|
|
. ds q
|
|
.\}
|
|
.if t \{\
|
|
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|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.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
|
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
|
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
|
.ds ae a\h'-(\w'a'u*4/10)'e
|
|
.ds Ae A\h'-(\w'A'u*4/10)'E
|
|
.ds oe o\h'-(\w'o'u*4/10)'e
|
|
.ds Oe O\h'-(\w'O'u*4/10)'E
|
|
. \" corrections for vroff
|
|
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
|
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
|
. \" for low resolution devices (crt and lpr)
|
|
.if \n(.H>23 .if \n(.V>19 \
|
|
\{\
|
|
. ds : e
|
|
. ds 8 ss
|
|
. ds v \h'-1'\o'\(aa\(ga'
|
|
. ds _ \h'-1'^
|
|
. ds . \h'-1'.
|
|
. ds 3 3
|
|
. ds o a
|
|
. ds d- d\h'-1'\(ga
|
|
. ds D- D\h'-1'\(hy
|
|
. ds th \o'bp'
|
|
. ds Th \o'LP'
|
|
. ds ae ae
|
|
. ds Ae AE
|
|
. ds oe oe
|
|
. ds Oe OE
|
|
.\}
|
|
.rm #[ #] #H #V #F C
|
|
.SH "NAME"
|
|
s_server \- SSL/TLS server program
|
|
.SH "SYNOPSIS"
|
|
\fBopenssl\fR \fBs_client\fR
|
|
[\fB\-accept port\fR]
|
|
[\fB\-context id\fR]
|
|
[\fB\-verify depth\fR]
|
|
[\fB\-Verify depth\fR]
|
|
[\fB\-cert filename\fR]
|
|
[\fB\-key keyfile\fR]
|
|
[\fB\-dcert filename\fR]
|
|
[\fB\-dkey keyfile\fR]
|
|
[\fB\-dhparam filename\fR]
|
|
[\fB\-nbio\fR]
|
|
[\fB\-nbio_test\fR]
|
|
[\fB\-crlf\fR]
|
|
[\fB\-debug\fR]
|
|
[\fB\-state\fR]
|
|
[\fB\-CApath directory\fR]
|
|
[\fB\-CAfile filename\fR]
|
|
[\fB\-nocert\fR]
|
|
[\fB\-cipher cipherlist\fR]
|
|
[\fB\-quiet\fR]
|
|
[\fB\-no_tmp_rsa\fR]
|
|
[\fB\-ssl2\fR]
|
|
[\fB\-ssl3\fR]
|
|
[\fB\-tls1\fR]
|
|
[\fB\-no_ssl2\fR]
|
|
[\fB\-no_ssl3\fR]
|
|
[\fB\-no_tls1\fR]
|
|
[\fB\-no_dhe\fR]
|
|
[\fB\-bugs\fR]
|
|
[\fB\-hack\fR]
|
|
[\fB\-www\fR]
|
|
[\fB\-WWW\fR]
|
|
.SH "DESCRIPTION"
|
|
The \fBs_server\fR command implements a generic SSL/TLS server which listens
|
|
for connections on a given port using SSL/TLS.
|
|
.SH "OPTIONS"
|
|
.Ip "\fB\-accept port\fR" 4
|
|
the \s-1TCP\s0 port to listen on for connections. If not specified 4433 is used.
|
|
.Ip "\fB\-context id\fR" 4
|
|
sets the \s-1SSL\s0 context id. It can be given any string value. If this option
|
|
is not present a default value will be used.
|
|
.Ip "\fB\-cert certname\fR" 4
|
|
The certificate to use, most servers cipher suites require the use of a
|
|
certificate and some require a certificate with a certain public key type:
|
|
for example the \s-1DSS\s0 cipher suites require a certificate containing a \s-1DSS\s0
|
|
(\s-1DSA\s0) key. If not specified then the filename \*(L"server.pem\*(R" will be used.
|
|
.Ip "\fB\-key keyfile\fR" 4
|
|
The private key to use. If not specified then the certificate file will
|
|
be used.
|
|
.Ip "\fB\-dcert filename\fR, \fB\-dkey keyname\fR" 4
|
|
specify an additional certificate and private key, these behave in the
|
|
same manner as the \fB\-cert\fR and \fB\-key\fR options except there is no default
|
|
if they are not specified (no additional certificate and key is used). As
|
|
noted above some cipher suites require a certificate containing a key of
|
|
a certain type. Some cipher suites need a certificate carrying an \s-1RSA\s0 key
|
|
and some a \s-1DSS\s0 (\s-1DSA\s0) key. By using \s-1RSA\s0 and \s-1DSS\s0 certificates and keys
|
|
a server can support clients which only support \s-1RSA\s0 or \s-1DSS\s0 cipher suites
|
|
by using an appropriate certificate.
|
|
.Ip "\fB\-nocert\fR" 4
|
|
if this option is set then no certificate is used. This restricts the
|
|
cipher suites available to the anonymous ones (currently just anonymous
|
|
\s-1DH\s0).
|
|
.Ip "\fB\-dhparam filename\fR" 4
|
|
the \s-1DH\s0 parameter file to use. The ephemeral \s-1DH\s0 cipher suites generate keys
|
|
using a set of \s-1DH\s0 parameters. If not specified then an attempt is made to
|
|
load the parameters from the server certificate file. If this fails then
|
|
a static set of parameters hard coded into the s_server program will be used.
|
|
.Ip "\fB\-nodhe\fR" 4
|
|
if this option is set then no \s-1DH\s0 parameters will be loaded effectively
|
|
disabling the ephemeral \s-1DH\s0 cipher suites.
|
|
.Ip "\fB\-no_tmp_rsa\fR" 4
|
|
certain export cipher suites sometimes use a temporary \s-1RSA\s0 key, this option
|
|
disables temporary \s-1RSA\s0 key generation.
|
|
.Ip "\fB\-verify depth\fR, \fB\-Verify depth\fR" 4
|
|
The verify depth to use. This specifies the maximum length of the
|
|
client certificate chain and makes the server request a certificate from
|
|
the client. With the \fB\-verify\fR option a certificate is requested but the
|
|
client does not have to send one, with the \fB\-Verify\fR option the client
|
|
must supply a certificate or an error occurs.
|
|
.Ip "\fB\-CApath directory\fR" 4
|
|
The directory to use for client certificate verification. This directory
|
|
must be in \*(L"hash format\*(R", see \fBverify\fR for more information. These are
|
|
also used when building the server certificate chain.
|
|
.Ip "\fB\-CAfile file\fR" 4
|
|
A file containing trusted certificates to use during client authentication
|
|
and to use when attempting to build the server certificate chain. The list
|
|
is also used in the list of acceptable client CAs passed to the client when
|
|
a certificate is requested.
|
|
.Ip "\fB\-state\fR" 4
|
|
prints out the \s-1SSL\s0 session states.
|
|
.Ip "\fB\-debug\fR" 4
|
|
print extensive debugging information including a hex dump of all traffic.
|
|
.Ip "\fB\-nbio_test\fR" 4
|
|
tests non blocking I/O
|
|
.Ip "\fB\-nbio\fR" 4
|
|
turns on non blocking I/O
|
|
.Ip "\fB\-crlf\fR" 4
|
|
this option translated a line feed from the terminal into \s-1CR+LF\s0.
|
|
.Ip "\fB\-quiet\fR" 4
|
|
inhibit printing of session and certificate information.
|
|
.Ip "\fB\-ssl2\fR, \fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl2\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR" 4
|
|
these options disable the use of certain \s-1SSL\s0 or \s-1TLS\s0 protocols. By default
|
|
the initial handshake uses a method which should be compatible with all
|
|
servers and permit them to use \s-1SSL\s0 v3, \s-1SSL\s0 v2 or \s-1TLS\s0 as appropriate.
|
|
.Ip "\fB\-bugs\fR" 4
|
|
there are several known bug in \s-1SSL\s0 and \s-1TLS\s0 implementations. Adding this
|
|
option enables various workarounds.
|
|
.Ip "\fB\-hack\fR" 4
|
|
this option enables a further workaround for some some early Netscape
|
|
\s-1SSL\s0 code (?).
|
|
.Ip "\fB\-cipher cipherlist\fR" 4
|
|
this allows the cipher list used by the server to be modified. When
|
|
the client sends a list of supported ciphers the first client cipher
|
|
also included in the server list is used. Because the client specifies
|
|
the preference order, the order of the server cipherlist irrelevant. See
|
|
the \fBciphers\fR command for more information.
|
|
.Ip "\fB\-www\fR" 4
|
|
sends a status message back to the client when it connects. This includes
|
|
lots of information about the ciphers used and various session parameters.
|
|
The output is in \s-1HTML\s0 format so this option will normally be used with a
|
|
web browser.
|
|
.Ip "\fB\-\s-1WWW\s0\fR" 4
|
|
emulates a simple web server. Pages will be resolved relative to the
|
|
current directory, for example if the \s-1URL\s0 https://myhost/page.html is
|
|
requested the file ./page.html will be loaded.
|
|
.SH "CONNECTED COMMANDS"
|
|
If a connection request is established with an SSL client and neither the
|
|
\fB\-www\fR nor the \fB\-WWW\fR option has been used then normally any data received
|
|
from the client is displayed and any key presses will be sent to the client.
|
|
.PP
|
|
Certain single letter commands are also recognized which perform special
|
|
operations: these are listed below.
|
|
.Ip "\fBq\fR" 4
|
|
end the current \s-1SSL\s0 connection but still accept new connections.
|
|
.Ip "\fBQ\fR" 4
|
|
end the current \s-1SSL\s0 connection and exit.
|
|
.Ip "\fBr\fR" 4
|
|
renegotiate the \s-1SSL\s0 session.
|
|
.Ip "\fBR\fR" 4
|
|
renegotiate the \s-1SSL\s0 session and request a client certificate.
|
|
.Ip "\fBP\fR" 4
|
|
send some plain text down the underlying \s-1TCP\s0 connection: this should
|
|
cause the client to disconnect due to a protocol violation.
|
|
.Ip "\fBS\fR" 4
|
|
print out some session cache status information.
|
|
.SH "NOTES"
|
|
\fBs_server\fR can be used to debug SSL clients. To accept connections from
|
|
a web browser the command:
|
|
.PP
|
|
.Vb 1
|
|
\& openssl s_server -accept 443 -www
|
|
.Ve
|
|
can be used for example.
|
|
.PP
|
|
Most web browsers (in particular Netscape and MSIE) only support RSA cipher
|
|
suites, so they cannot connect to servers which don't use a certificate
|
|
carrying an RSA key or a version of OpenSSL with RSA disabled.
|
|
.PP
|
|
Although specifying an empty list of CAs when requesting a client certificate
|
|
is strictly speaking a protocol violation, some SSL clients interpret this to
|
|
mean any CA is acceptable. This is useful for debugging purposes.
|
|
.PP
|
|
The session parameters can printed out using the \fBsess_id\fR program.
|
|
.SH "BUGS"
|
|
Because this program has a lot of options and also because some of
|
|
the techniques used are rather old, the C source of s_server is rather
|
|
hard to read and not a model of how things should be done. A typical
|
|
SSL server program would be much simpler.
|
|
.PP
|
|
The output of common ciphers is wrong: it just gives the list of ciphers that
|
|
OpenSSL recognizes and the client supports.
|
|
.PP
|
|
There should be a way for the \fBs_server\fR program to print out details of any
|
|
unknown cipher suites a client says it supports.
|
|
.SH "SEE ALSO"
|
|
the \fIsess_id(1)|sess_id(1)\fR manpage, the \fIs_client(1)|s_client(1)\fR manpage, the \fIciphers(1)|ciphers(1)\fR manpage
|
|
|
|
.rn }` ''
|
|
.IX Title "S_SERVER 1"
|
|
.IX Name "s_server - SSL/TLS server program"
|
|
|
|
.IX Header "NAME"
|
|
|
|
.IX Header "SYNOPSIS"
|
|
|
|
.IX Header "DESCRIPTION"
|
|
|
|
.IX Header "OPTIONS"
|
|
|
|
.IX Item "\fB\-accept port\fR"
|
|
|
|
.IX Item "\fB\-context id\fR"
|
|
|
|
.IX Item "\fB\-cert certname\fR"
|
|
|
|
.IX Item "\fB\-key keyfile\fR"
|
|
|
|
.IX Item "\fB\-dcert filename\fR, \fB\-dkey keyname\fR"
|
|
|
|
.IX Item "\fB\-nocert\fR"
|
|
|
|
.IX Item "\fB\-dhparam filename\fR"
|
|
|
|
.IX Item "\fB\-nodhe\fR"
|
|
|
|
.IX Item "\fB\-no_tmp_rsa\fR"
|
|
|
|
.IX Item "\fB\-verify depth\fR, \fB\-Verify depth\fR"
|
|
|
|
.IX Item "\fB\-CApath directory\fR"
|
|
|
|
.IX Item "\fB\-CAfile file\fR"
|
|
|
|
.IX Item "\fB\-state\fR"
|
|
|
|
.IX Item "\fB\-debug\fR"
|
|
|
|
.IX Item "\fB\-nbio_test\fR"
|
|
|
|
.IX Item "\fB\-nbio\fR"
|
|
|
|
.IX Item "\fB\-crlf\fR"
|
|
|
|
.IX Item "\fB\-quiet\fR"
|
|
|
|
.IX Item "\fB\-ssl2\fR, \fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl2\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR"
|
|
|
|
.IX Item "\fB\-bugs\fR"
|
|
|
|
.IX Item "\fB\-hack\fR"
|
|
|
|
.IX Item "\fB\-cipher cipherlist\fR"
|
|
|
|
.IX Item "\fB\-www\fR"
|
|
|
|
.IX Item "\fB\-\s-1WWW\s0\fR"
|
|
|
|
.IX Header "CONNECTED COMMANDS"
|
|
|
|
.IX Item "\fBq\fR"
|
|
|
|
.IX Item "\fBQ\fR"
|
|
|
|
.IX Item "\fBr\fR"
|
|
|
|
.IX Item "\fBR\fR"
|
|
|
|
.IX Item "\fBP\fR"
|
|
|
|
.IX Item "\fBS\fR"
|
|
|
|
.IX Header "NOTES"
|
|
|
|
.IX Header "BUGS"
|
|
|
|
.IX Header "SEE ALSO"
|
|
|