OpenSSL DH Key Too Small Error
<p>I am trying to connect to a closed-off server - an air-conditioner - using a simple PERL script</p>

<pre><code>#!/usr/bin/perl

use 5.10.1;
use warnings;
use strict;
use IO::Socket::SSL;
use IO::Socket::SSL qw/debug3/;
my $sock = IO::Socket::SSL-&gt;new(
        PeerHost =&gt; '192.168.1.4',
        PeerPort =&gt; 2878,
        verify_hostname =&gt; 0,   
        SSL_verify_mode =&gt; SSL_VERIFY_NONE,
        SSL_verifycn_scheme =&gt; undef
) or die "failed connect or ssl handshake: $!,$SSL_ERROR";
print "$sock\n";
</code></pre>

<p>Now, this was all working well and good, then I updated OpenSSL (libssl1.0.0) to be exact, and all hell broke loose:</p>

<pre><code>DEBUG: .../IO/Socket/SSL.pm:220: set domain to 2
DEBUG: .../IO/Socket/SSL.pm:1653: new ctx 1984680
DEBUG: .../IO/Socket/SSL.pm:363: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:365: socket connected
DEBUG: .../IO/Socket/SSL.pm:383: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:446: Net::SSLeay::connect -&gt; -1
DEBUG: .../IO/Socket/SSL.pm:1328: SSL connect attempt failed with unknown error error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small

DEBUG: .../IO/Socket/SSL.pm:452: fatal SSL error: SSL connect attempt failed with unknown error error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small
DEBUG: .../IO/Socket/SSL.pm:1328: IO::Socket::INET6 configuration failed error:00000000:lib(0):func(0):reason(0)

DEBUG: .../IO/Socket/SSL.pm:1690: free ctx 1984680 open=1984680
DEBUG: .../IO/Socket/SSL.pm:1698: OK free ctx 1984680
failed connect or ssl handshake: ,IO::Socket::INET6 configuration failed error:00000000:lib(0):func(0):reason(0) at ./spare line 9.
</code></pre>

<p>I am happy to use any alternative packages to get around this, but I do need to get around it, as I can't update the certificate on the air-conditioner...</p>

<p>I have looked in to using LWP and raw Net:SSLeay, but the problem seems to be in the underlying OpenSSL libs.</p>