Lemonldap-NG-Manager

 view release on metacpan or  search on metacpan

lib/Lemonldap/NG/Manager/Conf.pm  view on Meta::CPAN

#@param $req Lemonldap::NG::Common::PSGI::Request object
#@return PSGI JSON response
sub newEcKeys {
    my ( $self, $req, @others ) = @_;

    my $keys = Lemonldap::NG::Common::Util::Crypto::genEcKey('secp256r1');
    return $self->sendJSONresponse( $req, $keys );
}

# This function does the dirty X509 work,
# mostly copied from IO::Socket::SSL::Utils
# and adapter to work on old platforms (CentOS7)

sub _generateX509 {
    my ( $self, $password ) = @_;
    my $conf = $self->confAcc->getConf();
    my $key_size = $self->defaultNewKeySize;
    my $portal_uri  = new URI::URL( $conf->{portal} || "http://localhost" );
    my $portal_host = $portal_uri->host;

    return Lemonldap::NG::Common::Util::Crypto::genCertKey($key_size, $password, $portal_host);

lib/Lemonldap/NG/Manager/Conf/Tests.pm  view on Meta::CPAN

        },

        # Test support of timeouts for LDAPS connections
        ldapsNoTimeout => sub {

            # Skip test if no SMTP configuration
            return (1) unless ( $conf->{ldapServer} );

            if ( $conf->{ldapServer} =~ /ldaps:/ ) {

                if ( eval "require IO::Socket::SSL; require IO::Socket::IP;" ) {
                    if ( IO::Socket::SSL->isa('IO::Socket::IP') ) {
                        unless ( eval { IO::Socket::IP->VERSION(0.31) } ) {
                            return ( 1,
"Your version of IO::Socket::IP is too old to enforce "
                                  . "connection timeouts on ldaps:// URLs. Use ldap+tls:// instead"
                            );
                        }
                    }
                }
            }
            return (1);



( run in 0.500 second using v1.01-cache-2.11-cpan-4d50c553e7e )