stta/stta/perl-ldap-0.26/blib/man3/Net::LDAPS.3pm
2021-10-01 20:35:43 +01:00

282 lines
8.8 KiB
Groff
Executable File

.\" Automatically generated by Pod::Man version 1.15
.\" Fri Oct 4 06:36:41 2002
.\"
.\" Standard preamble:
.\" ======================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
.\" to do unbreakable dashes and therefore won't be available. \*(C` and
.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.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" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr
.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
.\" index entries marked with X<> in POD. Of course, you'll have to process
.\" the output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it
.\" makes way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
.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 /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.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
. \" 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 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
.\}
.rm #[ #] #H #V #F C
.\" ======================================================================
.\"
.IX Title "Net::LDAPS 3"
.TH Net::LDAPS 3 "perl v5.6.1" "2002-06-03" "User Contributed Perl Documentation"
.UC
.SH "NAME"
Net::LDAPS \- use \s-1LDAP\s0 over an \s-1SSL\s0 connection
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Net::LDAPS;
.Ve
.Vb 4
\& $ldaps = new Net::LDAPS('myhost.example.com',
\& port => '10000',
\& verify => 'require',
\& capath => '/usr/local/cacerts/');
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Communicate using the \s-1LDAP\s0 protocol to a directory server using a
potentially encrypted (\s-1SSL\s0) network connection.
.PP
This class is a subclass of Net::LDAP so all the normal Net::LDAP
methods can be used with a Net::LDAPS object; see the documentation
for Net::LDAP to find out how to query a directory server using the
\&\s-1LDAP\s0 protocol.
.PP
Note that the use of \s-1LDAPS\s0 is not recommended, because it is not
described by any \s-1IETF\s0 documents. Instead, you should consider using
LDAPv3 with the \s-1TLS\s0 extension defined in \s-1RFC\s0 2830. This will give you
the same functionality as \s-1LDAPS\s0, but using recognized standards. See
the start_tls entry in the Net::LDAP manpage.
.SH "CONSTRUCTOR"
.IX Header "CONSTRUCTOR"
.Ip "new ( \s-1HOST\s0 [, \s-1OPTIONS\s0 ] )" 4
.IX Item "new ( HOST [, OPTIONS ] )"
Create a new connection. \s-1HOST\s0 is the hostname to contact. \s-1OPTIONS\s0 is a
number of key/value pairs \- additional keys to those understood by
Net::LDAP::new are:
.RS 4
.Ip "verify" 4
.IX Item "verify"
How to verify the server's certificate, either 'none' (the server may
provide a certificate but it will not be checked \- this may mean you
are be connected to the wrong server), 'optional' (verify if the
server offers a certificate), or 'require' (the server must provide a
certificate, and it must be valid.) If you set verify to optional or
require, you must also set either cafile or capath. The most secure
option is 'require'.
.Ip "sslversion" 4
.IX Item "sslversion"
This defines the version of the \s-1SSL/TLS\s0 protocol to use. Defaults to
\&'sslv2/3', other possible values are 'sslv2', 'sslv3', and 'tlsv1'.
.Ip "ciphers" 4
.IX Item "ciphers"
Specify which subset of cipher suites are permissible for this
connection, using the standard OpenSSL string format. The default
value for ciphers is '\s-1ALL\s0', which permits all ciphers, even those that
don't encrypt!
.Ip "clientcert" 4
.IX Item "clientcert"
.PD 0
.Ip "clientkey" 4
.IX Item "clientkey"
.Ip "decryptkey" 4
.IX Item "decryptkey"
.PD
If you want to use the client to offer a certificate to the server for
\&\s-1SSL\s0 authentication (which is not the same as for the \s-1LDAP\s0 Bind
operation) then set clientcert to the user's certificate file, and
clientkey to the user's private key file. These files must be in \s-1PEM\s0
format.
.Sp
If the private key is encrypted (highly recommended!) then set
decryptkey to a reference to a subroutine that returns the decrypting
key. For example:
.Sp
.Vb 7
\& $ldaps = new Net::LDAPS('myhost.example.com',
\& port => '636',
\& verify => 'require',
\& clientcert => 'mycert.pem',
\& clientkey => 'mykey.pem',
\& decryptkey => sub { 'secret'; },
\& capath => '/usr/local/cacerts/');
.Ve
.Ip "capath" 4
.IX Item "capath"
.PD 0
.Ip "cafile" 4
.IX Item "cafile"
.PD
When verifying the server's certificate, either set capath to the
pathname of the directory containing \s-1CA\s0 certificates, or set cafile to
the filename containing the certificate of the \s-1CA\s0 who signed the
server's certificate. These certificates must all be in \s-1PEM\s0 format.
.Sp
The directory in 'capath' must contain certificates named using the
hash value of the certificates' subject names. To generate these
names, use OpenSSL like this in Unix:
.Sp
.Vb 1
\& ln -s cacert.pem `openssl x509 -hash -noout < cacert.pem`.0
.Ve
(assuming that the certificate of the \s-1CA\s0 is in cacert.pem.)
.RE
.RS 4
.RE
.SH "ADDITIONAL METHODS"
.IX Header "ADDITIONAL METHODS"
.Ip "cipher" 4
.IX Item "cipher"
Returns the cipher mode being used by the connection, in the string
format used by OpenSSL.
.Ip "certificate" 4
.IX Item "certificate"
Returns an X509_Certificate object containing the server's
certificate. See the \s-1IO:\s0:Socket::SSL documentation for information
about this class.
.Sp
For example, to get the subject name (in a peculiar OpenSSL-specific
format, different from \s-1RFC\s0 1779 and \s-1RFC\s0 2253) from the server's
certificate, do this:
.Sp
.Vb 1
\& print "Subject DN: " . $ldaps->certificate->subject_name . "\en";
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
the Net::LDAP manpage,
the IO::Socket::SSL manpage
.SH "BUGS"
.IX Header "BUGS"
You cannot have more than one \s-1LDAPS\s0 connection at any one time, due to
restrictions in the underlying Net::SSLeay code.
.SH "AUTHOR"
.IX Header "AUTHOR"
Chris Ridd <chris.ridd@messagingdirect.com>
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (c) 2000\-2002, Chris Ridd and Graham Barr. All rights reserved. This
library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.