1Net::SSLGlue::SMTP(3) User Contributed Perl DocumentationNet::SSLGlue::SMTP(3)
2
3
4
6 Net::SSLGlue::SMTP - make Net::SMTP able to use SSL
7
9 use Net::SSLGlue::SMTP;
10 my $smtp_ssl = Net::SMTP->new( $host,
11 SSL => 1,
12 SSL_ca_path => ...
13 );
14
15 my $smtp_plain = Net::SMTP->new( $host );
16 $smtp_plain->starttls( SSL_ca_path => ... );
17
19 Net::SSLGlue::SMTP extends Net::SMTP so one can either start directly
20 with SSL or switch later to SSL using the STARTTLS command.
21
22 By default it will take care to verify the certificate according to the
23 rules for SMTP implemented in IO::Socket::SSL.
24
26 new The method "new" of Net::SMTP is now able to start directly with
27 SSL when the argument "<SSL =" 1>> is given. In this case it will
28 not create an IO::Socket::INET object but an IO::Socket::SSL
29 object. One can give the usual "SSL_*" parameter of IO::Socket::SSL
30 to "Net::SMTP::new".
31
32 starttls
33 If the connection is not yet SSLified it will issue the STARTTLS
34 command and change the object, so that SSL will now be used. The
35 usual "SSL_*" parameter of IO::Socket::SSL will be given.
36
37 peer_certificate ...
38 Once the SSL connection is established the object is derived from
39 IO::Socket::SSL so that you can use this method to get information
40 about the certificate. See the IO::Socket::SSL documentation.
41
42 All of these methods can take the "SSL_*" parameter from
43 IO::Socket::SSL to change the behavior of the SSL connection. The
44 following parameters are especially useful:
45
46 SSL_ca_path, SSL_ca_file
47 Specifies the path or a file where the CAs used for checking the
48 certificates are located. This is typically "etc/ssl/certs" on UNIX
49 systems.
50
51 SSL_verify_mode
52 If set to 0, verification of the certificate will be disabled. By
53 default it is set to 1 which means that the peer certificate is
54 checked.
55
56 SSL_verifycn_name
57 Usually the name given as the hostname in the constructor is used
58 to verify the identity of the certificate. If you want to check the
59 certificate against another name you can specify it with this
60 parameter.
61
63 IO::Socket::SSL, Net::SMTP
64
66 This module is copyright (c) 2008, Steffen Ullrich. All Rights
67 Reserved. This module is free software. It may be used, redistributed
68 and/or modified under the same terms as Perl itself.
69
70
71
72perl v5.12.3 2011-05-27 Net::SSLGlue::SMTP(3)