Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Cause:
Net::LDAP sets global SSL options during connection.
Consequence:
Setting the global SSL option break further usage of SSL in the same script.
Fix:
Stop setting global SSL settings via IO::Socket::SSL::context_init() in Net::LDAP::start_tls().
Result:
Successful connection and SSL/TLS verification.
Created attachment 1012341[details]
Script that demonstrates the problem
Description of problem:
The version of Net::LDAP in the perl-LDAP package sets a global "SSL_verifycn_name" option in IO::Socket::SSL that causes any later SSL/TLS use (such as by LWP::UserAgent) to fail on verification.
Version-Release number of selected component (if applicable):
perl-LDAP-0.56-3.el7.noarch
Steps to Reproduce:
1. in a perl script, use Net::LDAP to connect to an ldap server with TLS enabled and certificate verified. Something like this:
my $ldap = Net::LDAP->new($ldaps_server);
my $msg = $ldap->start_tls(
verify => 'require',
cafile => '/etc/pki/tls/certs/ca-bundle.crt',
);
2. Later in that same perl script, do something else with SSL or TLS, such as use LWP to connect to an https URL, such as this:
my $lwp = LWP::UserAgent->new();
my $res = $lwp->get($https_url);
if ($res->is_success) {
print "LWP connected to $https_url\n";
} else {
print IO::Socket::SSL::errstr(),"\n";
die $res->status_line;
}
Actual results:
IO::Socket::IP configuration failed SSL connect attempt failed with unknown error error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Expected results:
Successful connection and SSL/TLS verification.
Additional info:
This can be worked around by unsetting the global option in IO::Socket::SSL, like this:
IO::Socket::SSL::set_defaults(SSL_verifycn_name => undef);
If the same https connection is made prior to the ldap connection, there is no problem.
This workaround is not needed on RHEL6.6 or on Fedora 21.
I'm attaching a script that demonstrates the problem. Run with "--enableworkaround" to unset the variable.
How to test:
1) Install perl, perl-LDAP, perl-IO-Socket-SSL and perl-LWP-Protocol-https
2) Download and run the attached test script net-ldap-bug-demo.pl (attachment #1012341[details])
3) The output does not contain any IO::Socket::IP failure.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2016-2200.html
Created attachment 1012341 [details] Script that demonstrates the problem Description of problem: The version of Net::LDAP in the perl-LDAP package sets a global "SSL_verifycn_name" option in IO::Socket::SSL that causes any later SSL/TLS use (such as by LWP::UserAgent) to fail on verification. Version-Release number of selected component (if applicable): perl-LDAP-0.56-3.el7.noarch Steps to Reproduce: 1. in a perl script, use Net::LDAP to connect to an ldap server with TLS enabled and certificate verified. Something like this: my $ldap = Net::LDAP->new($ldaps_server); my $msg = $ldap->start_tls( verify => 'require', cafile => '/etc/pki/tls/certs/ca-bundle.crt', ); 2. Later in that same perl script, do something else with SSL or TLS, such as use LWP to connect to an https URL, such as this: my $lwp = LWP::UserAgent->new(); my $res = $lwp->get($https_url); if ($res->is_success) { print "LWP connected to $https_url\n"; } else { print IO::Socket::SSL::errstr(),"\n"; die $res->status_line; } Actual results: IO::Socket::IP configuration failed SSL connect attempt failed with unknown error error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Expected results: Successful connection and SSL/TLS verification. Additional info: This can be worked around by unsetting the global option in IO::Socket::SSL, like this: IO::Socket::SSL::set_defaults(SSL_verifycn_name => undef); If the same https connection is made prior to the ldap connection, there is no problem. This workaround is not needed on RHEL6.6 or on Fedora 21. I'm attaching a script that demonstrates the problem. Run with "--enableworkaround" to unset the variable.