Bug 263192 - net-mgmt/nagios-plugins: Fix check_smtp certificate
Summary: net-mgmt/nagios-plugins: Fix check_smtp certificate
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Danilo G. Baio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-10 11:07 UTC by Alan Hicks
Modified: 2022-09-09 17:10 UTC (History)
4 users (show)

See Also:
dbaio: maintainer-feedback+


Attachments
Fixes inability to check a certificate with --starttls (290 bytes, patch)
2022-04-10 17:09 UTC, Alan Hicks
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Hicks 2022-04-10 11:07:23 UTC
check_smtp is unable to check a certificate --starttls errors with:
check_smtp: Set either -s/--ssl or -S/--starttls

neither --ssl nor --starttls and --ssl errors with:
CRITICAL - Cannot make SSL connection.
34374492160:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:/usr/src/crypto/openssl/ssl/record/ssl3_record.c:358:
CRITICAL - Cannot create SSL context.

check_smtp works with --starttls and without --certificate

nagios-plugins-2.4.0,1
FreeBSD 13.0-RELEASE-p6
Comment 1 Alan Hicks 2022-04-10 17:09:12 UTC
Created attachment 233125 [details]
Fixes inability to check a certificate with --starttls

This is a simple omission of a break; to stop the D (certificate) option falling through to include the s (ssl) option.

This has also been offered upstream
https://github.com/nagios-plugins/nagios-plugins/pull/649
Comment 2 Danilo G. Baio freebsd_committer freebsd_triage 2022-08-19 01:20:14 UTC
Hi.

I tested it, and it is working fine. Thanks for the patch.

As it was approved upstream, I'll take and push it here.

// maintainer timeout
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-08-19 01:27:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ced29daafbf87319adab2ebc14e46543399558ea

commit ced29daafbf87319adab2ebc14e46543399558ea
Author:     Alan Hicks <ahicks@p-o.co.uk>
AuthorDate: 2022-08-19 01:20:57 +0000
Commit:     Danilo G. Baio <dbaio@FreeBSD.org>
CommitDate: 2022-08-19 01:25:37 +0000

    net-mgmt/nagios-plugins: Fix check_smtp certificate

    https://github.com/nagios-plugins/nagios-plugins/pull/649

    PR:             263192
    Approved by:    maintainer timeout
    MFH:            2022Q3

 net-mgmt/nagios-plugins/Makefile                               |  1 +
 .../nagios-plugins/files/patch-plugins_check__smtp.c (new)     | 10 ++++++++++
 2 files changed, 11 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-08-19 01:32:37 UTC
A commit in branch 2022Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2fc14a6402c749fad57f81003e3c02781ec3bcbc

commit 2fc14a6402c749fad57f81003e3c02781ec3bcbc
Author:     Alan Hicks <ahicks@p-o.co.uk>
AuthorDate: 2022-08-19 01:20:57 +0000
Commit:     Danilo G. Baio <dbaio@FreeBSD.org>
CommitDate: 2022-08-19 01:31:12 +0000

    net-mgmt/nagios-plugins: Fix check_smtp certificate

    https://github.com/nagios-plugins/nagios-plugins/pull/649

    PR:             263192
    Approved by:    maintainer timeout
    MFH:            2022Q3

    (cherry picked from commit ced29daafbf87319adab2ebc14e46543399558ea)

 net-mgmt/nagios-plugins/Makefile                               |  1 +
 .../nagios-plugins/files/patch-plugins_check__smtp.c (new)     | 10 ++++++++++
 2 files changed, 11 insertions(+)
Comment 5 Danilo G. Baio freebsd_committer freebsd_triage 2022-08-19 01:33:37 UTC
Committed, thank you!
Comment 6 Fabian Wenk 2022-09-09 17:10:09 UTC
This patch did help for STARTTLS, but does not work (or broke) SSL. See https://github.com/nagios-plugins/nagios-plugins/issues/651#issuecomment-1242235492