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
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
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
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(+)
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(+)
Committed, thank you!
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