Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only initialize existing Net::SSLeay methods #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ppisar
Copy link

@ppisar ppisar commented Aug 13, 2024

Recent OpenSSL can be built without engine support and then Net-SSLeay is missing ENGINE_load_builtin_engines() and
ENGINE_register_all_complete() subroutines. In that case t/Port_Configuration.t failed like this:

$ prove -l -v  t/Port_Configuration.t
t/Port_Configuration.t ..
1..51
[...]
ok 34 - run ( ipv => '*', port => 'foo/bar/unix' )  ==>  [ '*|foo/bar|UNIX|*' ]
# Unable to load module for proto "Net::Server::Proto::SSLEAY": Can't use an undefined value as a subroutine reference at /home/test/fedora/perl-Net-Server/perl-Net-Server-2.014-build/Net-Server-2.014/lib/Net/Server/Proto/SSLEAY.pm line 31.
BEGIN failed--compilation aborted at /home/test/fedora/perl-Net-Server/perl-Net-Server-2.014-build/Net-Server-2.014/lib/Net/Server/Proto/SSLEAY.pm line 34.
Compilation failed in require at /home/test/fedora/perl-Net-Server/perl-Net-Server-2.014-build/Net-Server-2.014/lib/Net/Server/Proto.pm line 195.
 at line 318
# Failed at line 318
not ok 35 - run ( proto => 'ssleay' )  ==>  [ '' ]
#   failed at t/Port_Configuration.t line 73
#        got: {
  bind => undef
}
#   expected: {
  bind => [{
  host => '*',
  ipv => 4,
  port => 20203,
  proto => 'ssleay'
}],
  sock => [{
  NS_host => '*',
  NS_ipv => 4,
  NS_listen => 4096,
  NS_port => 20203,
  NS_proto => 'SSLEAY',
  SSL_cert_file => 'somecert'
}]
}
# number of tests ran 35 did not match number of specified tests 51
Failed 17/51 subtests

This patch calls the Net::SSLeay initialization routines only if they are defined.

Recent OpenSSL can be built without engine support and then Net-SSLeay
is missing ENGINE_load_builtin_engines() and
ENGINE_register_all_complete() subroutines. In that case
t/Port_Configuration.t failed like this:

    $ prove -l -v  t/Port_Configuration.t
    t/Port_Configuration.t ..
    1..51
    [...]
    ok 34 - run ( ipv => '*', port => 'foo/bar/unix' )  ==>  [ '*|foo/bar|UNIX|*' ]
    # Unable to load module for proto "Net::Server::Proto::SSLEAY": Can't use an undefined value as a subroutine reference at /home/test/fedora/perl-Net-Server/perl-Net-Server-2.014-build/Net-Server-2.014/lib/Net/Server/Proto/SSLEAY.pm line 31.
    BEGIN failed--compilation aborted at /home/test/fedora/perl-Net-Server/perl-Net-Server-2.014-build/Net-Server-2.014/lib/Net/Server/Proto/SSLEAY.pm line 34.
    Compilation failed in require at /home/test/fedora/perl-Net-Server/perl-Net-Server-2.014-build/Net-Server-2.014/lib/Net/Server/Proto.pm line 195.
     at line 318
    # Failed at line 318
    not ok 35 - run ( proto => 'ssleay' )  ==>  [ '' ]
    #   failed at t/Port_Configuration.t line 73
    #        got: {
      bind => undef
    }
    #   expected: {
      bind => [{
      host => '*',
      ipv => 4,
      port => 20203,
      proto => 'ssleay'
    }],
      sock => [{
      NS_host => '*',
      NS_ipv => 4,
      NS_listen => 4096,
      NS_port => 20203,
      NS_proto => 'SSLEAY',
      SSL_cert_file => 'somecert'
    }]
    }
    # number of tests ran 35 did not match number of specified tests 51
    Failed 17/51 subtests

This patch calls the Net::SSLeay initialization routines only if they are defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant