Commit graph

37 commits

Author SHA1 Message Date
Sven Nierlein
16121a9b55 check_curl: implement certificate checks
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-10-22 16:28:51 +02:00
Holger Weiss
8b727baec5 sslutils: Address compiler warning
SSLv23_client_method() and friends return a pointer to a const-qualified
SSL_METHOD.
2016-11-21 09:31:08 +01:00
Peter (pir) Radcliffe
2f2b2f1987 GMT expiry display
Change solution to display GMT time in the local display format with
the offset number of hours from GMT to be clear about what timezone
this is if the local display format does not include offset.
2016-11-07 22:42:40 +01:00
Peter (pir) Radcliffe
a3a78795b2 Use GMT timezone in SSL certs
SSL certs are required to use times in GMT per
https://www.ietf.org/rfc/rfc5280.txt but the mktime() here assumes the
current timezone.

Fix the time_t conversion to be done assuming GMT with timegm() and
only do it once rather than twice.

Display the expiry date and time with ISO format years and give an
offset from GMT and a timezone to be very clear about exactly what time
is being displayed. Time given is correct and now in the machine’s
timezone.
2016-11-07 22:42:40 +01:00
Holger Weiss
5029714a9d Merge branch 'pr/1373'
* pr/1373:
  check_http: Allow for requesting TLSv1.1/TLSv1.2
2015-10-06 12:57:29 +02:00
Holger Weiss
f43083c6a9 check_http: Allow for requesting TLSv1.1/TLSv1.2
check_http's -S/--ssl option now allows for requesting the TLSv1.1 and
TLSv1.2 protocols.  Apart from that, a '+' suffix can be appended in
oder to also accept newer protocols than the specified version.

Closes #1338, and closes #1354, and closes #1359.
2015-10-04 23:28:35 +02:00
Sven Nierlein
9eeb3e170f fix typo from #1336
if exactly one hour before the expire date, we would mixup
minutes and hours.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-02 15:56:19 +02:00
Matthias Hähnel
e1ed1d805e Update sslutils.c
Fixed Output if the expiration time is below one hour and code cleanup
2015-10-02 15:56:18 +02:00
Matthias Hähnel
2ce2296842 Update sslutils.c
optimize output if certificate expires in less then 24h
thx to axel.schmalowsky@sixt.com for this patch
2015-10-02 15:56:18 +02:00
Jan Wagner
3bf812beae sslutils: expire time in local timezone format
sshutils prints the expiry time of certificates in US format
this patch uses the strftime %c, I don't know how portable that is

Thanks to Neil Prockter.

Closes #1188
Closes #1161
Closes #977
Closes #976
Closes #975
Closes #840
Closes #382
2014-07-21 13:32:20 +02:00
Holger Weiss
083952c426 Fix compilation with GnuTLS
GnuTLS doesn't provide a SSL_CTX_check_private_key() function.

Closes #1254.
2014-06-12 00:02:26 +02:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
Holger Weiss
ca9ce71576 Don't mark SSL_METHOD variable as "const"
The SSL_CTX_new(3) function expects a non-"const" SSL_METHOD value.
2013-09-10 22:49:03 +02:00
Holger Weiss
5b0e00782d Move global variables from .h to .c files
Simplify things by moving the definition of global variables into .c
files, where they belong.
2013-09-10 22:45:45 +02:00
Holger Weiss
f4b90cabc0 Set SSL_MODE_AUTO_RETRY flag
We use OpenSSL (or GnuTLS) with blocking semantics, and we don't want
SSL_read(3) or SSL_write(3) calls to return SSL_ERROR_WANT_READ or
SSL_ERROR_WANT_WRITE (see #3614716).
2013-08-20 23:17:23 +02:00
Holger Weiss
64b4d1fb66 Abbreviate function name
Make a very long function name at least a little bit shorter.
2013-08-18 23:11:11 +02:00
Lionel Cons
2f92d0dab7 added support for client authentication via SSL 2013-05-17 15:00:09 +02:00
Sven Nierlein
24242f6ab7 check_http: added test for warning thresholds
fixed typo in sslutils
2012-06-25 12:53:47 +02:00
William Leibzon
fa3d2a4074 applied patch that adds both critical and warning thresholds to certificate expiration checks of check_tcp, check_http, check_smtp 2012-06-25 12:05:16 +02:00
Holger Weiss
4e9eedc8de Fix whitespace and capitalization issues
Fix indentation and whitespace issues, and correct some capitalization
errors in error messages.  The behaviour is unchanged.
2012-06-11 23:34:15 +02:00
Holger Weiss
3fd1bd97ca Don't use SSLv2 when compiling against GnuTLS
GnuTLS doesn't support SSL version 2.
2012-06-11 23:23:40 +02:00
Sebastian Harl
679a229606 sslutils: Check if OpenSSL supports SSLv2.
Recent versions/builds seem to disable that feature.
2012-06-06 13:48:52 +02:00
Holger Weiss
bc3307ed6e Add support for specifying SSL protocol version
The check_http -S/--ssl option now takes an optional argument which
specifies the desired SSL/TLS protocol version (#3285367 - Jason Lunn).
2012-05-28 17:16:04 +02:00
Holger Weiss
5a5d3d7013 Disable stateless SSL session resumption
Some versions of OpenSSL fail to negotiate the SSL connection with at
least some versions of Tomcat if stateless SSL session resumption
support (see RFC4507) is enabled:

| CRITICAL - Cannot make SSL connection
| 140099330348712:error:140943F2:SSL routines:SSL3_READ_BYTES:sslv3 alert unexpected message:s3_pkt.c:1195:SSL alert number 10

The problem is reproducible with OpenSSL 1.0.0h, but not with OpenSSL
0.9.8o-4squeeze12 (as shipped with Debian 6.0.4).  We work around it by
disabling the RFC4507 functionality when using OpenSSL versions which
support it.

Thanks to Dag Bakke for reporting the issue and for giving me access to
a server I could use to reproduce the problem.
2012-05-07 12:11:48 +02:00
Thomas Guyot-Sionnest
4611e41bc5 check_http: check for and print the certificate cn
This patch adds a check for the certificate cn (hostname) to normal
certificate checks. It returns CRITICAL if th cn is missing, otherwise it
prints it in the normal output.

Patch by Stéphane Urbanovski
2011-02-04 00:54:52 -05:00
Thomas Guyot-Sionnest
ecb33e787c Whitespace changes only 2009-05-20 14:06:29 -04:00
Thomas Guyot-Sionnest
0489df95fc check_http: Add SSL/TLS hostname extension support (SNI) - (#1939022 - Joe Presbrey) 2009-05-20 01:05:35 -04:00
Thomas Guyot-Sionnest
37e432ec77 Revert "Add timezone support and fix checks around cert expiration" (keep the expiration fix)
This reverts commit d41a33a434.
2009-03-19 01:04:33 -04:00
Thomas Guyot-Sionnest
d41a33a434 Add timezone support and fix checks around cert expiration 2009-03-18 03:34:25 -04:00
Thomas Guyot-Sionnest
6fbd14fea5 Removing CVS/SVN tags and replacing with git-based versioning
For contrib/, full tags have been imported from subversion


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-23 05:38:47 +00:00
Thomas Guyot-Sionnest
184ce9f6a3 Bump plugins/ to GPLv3 (non-plugind files)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1918 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-31 11:27:22 +00:00
Holger Weiss
f71de78952 Call the SSL library initialization functions only once (not for every
SSL connection).


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1726 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-01 22:57:31 +00:00
Holger Weiss
f747b865aa Save an entire CPU cycle if c points to NULL already.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1725 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-01 17:06:33 +00:00
Holger Weiss
bad9e04c54 Set the pointers to the SSL and SSL_CTX objects back to NULL after
freeing them in np_net_ssl_cleanup().  This fixes a check_http segfault
if an SSL site redirects to a non-SSL one (reported by Aravind Gottipati
via IRC).


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1724 f882894a-f735-0410-b71e-b25c423dba1c
2007-06-01 16:42:07 +00:00
Benoit Mortier
f9394308c9 updating help and usage and license
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1434 f882894a-f735-0410-b71e-b25c423dba1c
2006-06-18 19:36:48 +00:00
M. Sean Finney
3038819fef code cleanups, largely resulting from turning on -Wall. mostly
unused variables and explicit casting issues, but there were a
couple gotchas in there too.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1267 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-31 20:03:19 +00:00
M. Sean Finney
4c77862ce3 - compartmentalized ssl code into seperate sslutils.c
- ssl-related cleanups in configure.in, and now openssl/gnutls options
  automatically disable each other.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1258 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-23 11:59:43 +00:00