| 1 |
<?xml version="1.0" ?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<title>imap_ssl_cert - connects to an IMAP server using SSL and saves the server certificate into a .pem file</title> |
| 6 |
<link rel="stylesheet" href="plainwhite.css" type="text/css" /> |
| 7 |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
| 8 |
<link rev="made" href="mailto:[email protected]" /> |
| 9 |
</head> |
| 10 |
|
| 11 |
<body> |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
<div name="index"> |
| 16 |
<p><a name="__index__"></a></p> |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
</div> |
| 41 |
|
| 42 |
|
| 43 |
<p> |
| 44 |
</p> |
| 45 |
<hr /> |
| 46 |
<h1><a name="name">NAME</a></h1> |
| 47 |
<p>imap_ssl_cert - connects to an IMAP server using SSL and saves the server certificate into a .pem file</p> |
| 48 |
<p> |
| 49 |
</p> |
| 50 |
<hr /> |
| 51 |
<h1><a name="synopsis">SYNOPSIS</a></h1> |
| 52 |
<pre> |
| 53 |
imap_ssl_cert -H imap.server.com > server_ca_file.pem |
| 54 |
imap_ssl_cert -? |
| 55 |
imap_ssl_cert --help</pre> |
| 56 |
<p> |
| 57 |
</p> |
| 58 |
<hr /> |
| 59 |
<h1><a name="dependencies">DEPENDENCIES</a></h1> |
| 60 |
<p>This utility requires the following perl modules to be installed:</p> |
| 61 |
<p>Getopt::Long |
| 62 |
Mail::IMAPClient |
| 63 |
IO::Socket::SSL |
| 64 |
Net::SSLeay</p> |
| 65 |
<p> |
| 66 |
</p> |
| 67 |
<hr /> |
| 68 |
<h1><a name="options">OPTIONS</a></h1> |
| 69 |
<dl> |
| 70 |
<dt><strong><a name="timeout_seconds" class="item">--timeout <seconds></a></strong></dt> |
| 71 |
|
| 72 |
<dd> |
| 73 |
<p>Abort with critical status if it takes longer than <seconds> to connect to the IMAP server. Default is 60 seconds. |
| 74 |
The difference between timeout and critical is that, with the default settings, if it takes 45 seconds to |
| 75 |
connect to the server then the connection will succeed but the plugin will return CRITICAL because it took longer |
| 76 |
than 30 seconds. |
| 77 |
Also known as: -t <seconds></p> |
| 78 |
</dd> |
| 79 |
<dt><strong><a name="hostname_server" class="item">--hostname <server></a></strong></dt> |
| 80 |
|
| 81 |
<dd> |
| 82 |
<p>Address or name of the IMAP server. Examples: mail.server.com, localhost, 192.168.1.100 |
| 83 |
Also known as: -H <server></p> |
| 84 |
</dd> |
| 85 |
<dt><strong><a name="port_number" class="item">--port <number></a></strong></dt> |
| 86 |
|
| 87 |
<dd> |
| 88 |
<p>Service port on the IMAP server. Default is 143. If you use SSL, default is 993. |
| 89 |
Also known as: -p <number></p> |
| 90 |
</dd> |
| 91 |
<dt><strong><a name="verbose" class="item">--verbose</a></strong></dt> |
| 92 |
|
| 93 |
<dd> |
| 94 |
<p>Display additional information. Useful for troubleshooting.</p> |
| 95 |
<p>Also known as: -v</p> |
| 96 |
</dd> |
| 97 |
<dt><strong><a name="version" class="item">--version</a></strong></dt> |
| 98 |
|
| 99 |
<dd> |
| 100 |
<p>Display plugin version and exit. |
| 101 |
Also known as: -V</p> |
| 102 |
</dd> |
| 103 |
<dt><strong><a name="help" class="item">--help</a></strong></dt> |
| 104 |
|
| 105 |
<dd> |
| 106 |
<p>Display this documentation and exit. |
| 107 |
Also known as: -h</p> |
| 108 |
</dd> |
| 109 |
<dt><strong><a name="usage" class="item">--usage</a></strong></dt> |
| 110 |
|
| 111 |
<dd> |
| 112 |
<p>Display a short usage instruction and exit.</p> |
| 113 |
</dd> |
| 114 |
</dl> |
| 115 |
<p> |
| 116 |
</p> |
| 117 |
<hr /> |
| 118 |
<h1><a name="examples">EXAMPLES</a></h1> |
| 119 |
<p> |
| 120 |
</p> |
| 121 |
<h2><a name="print_the_server_s_ssl_certificate_chain">Print the server's SSL certificate chain</a></h2> |
| 122 |
<pre> |
| 123 |
$ perl imap_ssl_cert.pl -H imap.server.com > ca_file.pem |
| 124 |
$ cat ca_file.pem</pre> |
| 125 |
<pre> |
| 126 |
-----BEGIN CERTIFICATE----- |
| 127 |
MIID1zCCAr+gAwIBAgIQPr3bVk0SkuXygjxgA7EVGDANBgkqhkiG9w0BAQUFADA8 |
| 128 |
[...snip...] |
| 129 |
0FF4warjskrfqaVtWeIV58LJheaM4cPJkc2M |
| 130 |
-----END CERTIFICATE-----</pre> |
| 131 |
<pre> |
| 132 |
$ openssl x509 -in ca_file.pem -text</pre> |
| 133 |
<p> |
| 134 |
</p> |
| 135 |
<hr /> |
| 136 |
<h1><a name="see_also">SEE ALSO</a></h1> |
| 137 |
<p><a href="http://en.wikipedia.org/wiki/X.509">http://en.wikipedia.org/wiki/X.509</a> |
| 138 |
<a href="http://en.wikipedia.org/wiki/Privacy_Enhanced_Mail">http://en.wikipedia.org/wiki/Privacy_Enhanced_Mail</a> |
| 139 |
<a href="http://tools.ietf.org/html/rfc1422">http://tools.ietf.org/html/rfc1422</a> |
| 140 |
<a href="http://search.cpan.org/~mikem/Net-SSLeay-1.42/lib/Net/SSLeay.pm">http://search.cpan.org/~mikem/Net-SSLeay-1.42/lib/Net/SSLeay.pm</a> |
| 141 |
<a href="http://search.cpan.org/~plobbes/Mail-IMAPClient-3.29/lib/Mail/IMAPClient.pod">http://search.cpan.org/~plobbes/Mail-IMAPClient-3.29/lib/Mail/IMAPClient.pod</a></p> |
| 142 |
<p> |
| 143 |
</p> |
| 144 |
<hr /> |
| 145 |
<h1><a name="changes">CHANGES</a></h1> |
| 146 |
<pre> |
| 147 |
Fri Nov 11 03:38:13 AST 2011 |
| 148 |
+ version 0.1</pre> |
| 149 |
<p> |
| 150 |
</p> |
| 151 |
<hr /> |
| 152 |
<h1><a name="author">AUTHOR</a></h1> |
| 153 |
<p>Jonathan Buhacoff <<a href="mailto:[email protected]">[email protected]</a>></p> |
| 154 |
<p> |
| 155 |
</p> |
| 156 |
<hr /> |
| 157 |
<h1><a name="copyright_and_license">COPYRIGHT AND LICENSE</a></h1> |
| 158 |
<pre> |
| 159 |
Copyright (C) 2011 Jonathan Buhacoff</pre> |
| 160 |
<pre> |
| 161 |
This program is free software; you can redistribute it and/or modify |
| 162 |
it under the terms of the GNU General Public License as published by |
| 163 |
the Free Software Foundation; either version 3 of the License, or |
| 164 |
(at your option) any later version.</pre> |
| 165 |
<pre> |
| 166 |
This program is distributed in the hope that it will be useful, |
| 167 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 168 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 169 |
GNU General Public License for more details.</pre> |
| 170 |
<pre> |
| 171 |
You should have received a copy of the GNU General Public License |
| 172 |
along with this program. If not, see <<a href="http://www.gnu.org/licenses/>">http://www.gnu.org/licenses/></a>;.</pre> |
| 173 |
<pre> |
| 174 |
<a href="http://www.gnu.org/licenses/gpl.txt">http://www.gnu.org/licenses/gpl.txt</a></pre> |
| 175 |
|
| 176 |
</body> |
| 177 |
|
| 178 |
</html> |