[ nagiosplug-Bugs-3614716 ] np_net_ssl_read fails to take SSL_WANT_READ into account

SourceForge.net <[email protected]>
Newsgroups gmane.network.nagios.plugins.devel
Message-ID <[email protected]>
Bugs item #3614716, was opened at 2013-07-16 07:17
Message generated for change (Comment added) made by hweiss
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3614716&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: Release (specify)
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Pepijn Schmitz (pepijn)
Assigned to: Holger Weiss (hweiss)
Summary: np_net_ssl_read fails to take SSL_WANT_READ into account 

Initial Comment:
The np_net_ssl_read function in sslutils.c fails to take the SSL_ERROR_WANT_READ return code into account. This is not an error but indicates that the read should be retried. It can occur for instance when an SSL/TLS renegotiation occurs. This is causing the following check_http command to fail with a "HTTP CRITICAL - Error on receive" message, causing a false negative (the site in question works fine):

check_http -I www.essentialmall.com -S

The fix is to replace the np_net_ssl_read() function with this:

int np_net_ssl_read(void *buf, int num) {
        int rc;
        do {
                rc = SSL_read(s, buf, num);
        } while ((rc < 0) && (SSL_get_error(s, rc) == SSL_ERROR_WANT_READ));
        return rc;
}

----------------------------------------------------------------------

>Comment By: Holger Weiss (hweiss)
Date: 2013-08-20 14:34

Message:
This should be fixed in the current Git code.  You could try this out with
the current snapshot:

http://nagiosplug.sourceforge.net/snapshot/nagios-plugins-master.tar.gz

----------------------------------------------------------------------

Comment By: Pepijn Schmitz (pepijn)
Date: 2013-07-16 15:55

Message:
I guess the write function should be similarly adapted (for
SSL_ERROR_WANT_WRITE), but I have not seen that cause a problem yet.

----------------------------------------------------------------------

Comment By: Jan Wagner (cyco_dd)
Date: 2013-07-16 09:40

Message:
easiest way to get patches integrated is to send push requests to
https://github.com/nagios-plugins/nagios-plugins

----------------------------------------------------------------------

Comment By: Pepijn Schmitz (pepijn)
Date: 2013-07-16 07:19

Message:
This is in release 1.4.16.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3614716&group_id=29880

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.