{"id":743,"date":"2020-04-28T21:10:23","date_gmt":"2020-04-28T20:10:23","guid":{"rendered":"http:\/\/www.mb200d.nl\/wordpress\/?p=743"},"modified":"2020-04-28T21:13:58","modified_gmt":"2020-04-28T20:13:58","slug":"nagios-nrpe-server-2-15-could-not-complete-ssl-handshake-1","status":"publish","type":"post","link":"http:\/\/www.mb200d.nl\/wordpress\/2020\/04\/nagios-nrpe-server-2-15-could-not-complete-ssl-handshake-1\/","title":{"rendered":"Nagios NRPE Server 2.15 Could not complete SSL handshake. 1"},"content":{"rendered":"<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with &#x5B;ip] 1\n<\/pre><\/div>\n\n\n<p>Found out it had to do with the major version difference 3.x connecting to 2.x. Adding -2 to the command line made no difference. Disabling SSL was an solution. But not preferred.<\/p>\n\n\n\n<p>I recently upgraded (reinstalled) my vps from Debian Jessie to Debian Buster. I chose to install Nagios4 and NRPE client from Debian repositories. (Previous installation was build from source). I was using Nagios4x already, i guess the nrpe-plugins were a bit older.<\/p>\n\n\n\n<p>On the other side i have an Netgear ReadyNAS Pro 6 to be monitored. This system is still running Debian Jessie. To stay compatible with Netgear updates, i am not doing an dist-upgrade on the OS. Debian Jessie has nagios-nrpe-server 2.x in it&#8217;s main repository.<\/p>\n\n\n\n<p>While searching online, i came across a solution that rebuilds nagios-nrpe-server 2.x with a dh 2048 signature.<\/p>\n\n\n\n<p>I tried to do the same thing, with success. <\/p>\n\n\n\n<p>With <a href=\"https:\/\/wiki.debian.org\/BuildingTutorial\">https:\/\/wiki.debian.org\/BuildingTutorial<\/a> as base, i proceeded as following:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# Edit \/etc\/apt\/sources.list, add an deb-src line\ndeb-src http:\/\/mirrors.kernel.org\/debian jessie main\n<\/pre><\/div>\n\n\n<p>Now update apt<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt-get update\n<\/pre><\/div>\n\n\n<p>Create a working directory and get source code<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# Create working directory\nmkdir -p src\/debian\ncd src\/debian\n\n# Get source\napt-get source nagios-nrpe-server\n\n# Step into source\ncd nagios-nrpe-2.15\n\n# Build without patches, to check that all requirements a met\ndebuild -b -uc -us\n\n# When build failed, try\nsudo apt-get install build-essential fakeroot devscripts\n# and\nsudo apt-get build-dep nagios-nrpe-server\n<\/pre><\/div>\n\n\n<p>Now apply some changes to the source code.<\/p>\n\n\n\n<p>Edit .\/configure<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nOLD: $sslbin dhparam -C 512 | awk &#039;\/^-----\/ {exit} {print}&#039; &gt; include\/dh.h\nNEW: $sslbin dhparam -C 2048 | awk &#039;\/^-----\/ {exit} {print}&#039; &gt; include\/dh.h\n<\/pre><\/div>\n\n\n<p>Edit .\/configure.in<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nOLD: $sslbin dhparam -C 512 | awk &#039;\/^-----\/ {exit} {print}&#039; &gt; include\/dh.h\nNEW: $sslbin dhparam -C 2048 | awk &#039;\/^-----\/ {exit} {print}&#039; &gt; include\/dh.h\n<\/pre><\/div>\n\n\n<p>Edit .\/src\/nrpe.c <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nOLD: dh=get_dh512();\nNEW: dh=get_dh2048();\n<\/pre><\/div>\n\n\n<p>We can recompile now.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndebuild -b -uc -us\n<\/pre><\/div>\n\n\n<p>If no error occurred, there should be 2 new .deb packages in your working directory.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nInstall both\nsudo dpkg -i nagios-nrpe-plugin_2.15-1.deb\nsudo dpkg -i nagios-nrpe-server_2.15-1.deb\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Found out it had to do with the major version difference 3.x connecting to 2.x. Adding -2 to the command line made no difference. Disabling SSL was an solution. But not preferred. I recently upgraded (reinstalled) my vps from Debian Jessie to Debian Buster. I chose to install Nagios4 and NRPE client from Debian repositories. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,13,5,93],"tags":[94,335,334,336],"class_list":["post-743","post","type-post","status-publish","format-standard","hentry","category-debian","category-english","category-it-related","category-nagios","tag-nagios-2","tag-nrpe-client","tag-nrpe-server","tag-ssl_err-5"],"_links":{"self":[{"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/posts\/743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/comments?post=743"}],"version-history":[{"count":12,"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/posts\/743\/revisions"}],"predecessor-version":[{"id":755,"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/posts\/743\/revisions\/755"}],"wp:attachment":[{"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/media?parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/categories?post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mb200d.nl\/wordpress\/wp-json\/wp\/v2\/tags?post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}