2016-08-05 13:56:16 +02:00
|
|
|
use Test::More;
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
require 't/test-lib.pm';
|
|
|
|
|
|
|
|
my $res;
|
|
|
|
|
2016-11-14 13:34:46 +01:00
|
|
|
my $client = LLNG::Manager::Test->new(
|
2016-08-05 13:56:16 +02:00
|
|
|
{
|
2016-11-14 13:34:46 +01:00
|
|
|
ini => {
|
|
|
|
logLevel => 'error',
|
|
|
|
useSafeJail => 1,
|
|
|
|
authentication => 'SSL',
|
|
|
|
userDB => 'Null',
|
|
|
|
SSLVar => 'SSL_CLIENT_S_DN_Custom',
|
|
|
|
}
|
2016-08-05 13:56:16 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
ok(
|
2016-11-14 13:34:46 +01:00
|
|
|
$res = $client->_get(
|
2016-08-05 13:56:16 +02:00
|
|
|
'/', custom => { SSL_CLIENT_S_DN_Custom => 'dwho' }
|
|
|
|
),
|
|
|
|
'Auth query'
|
|
|
|
);
|
|
|
|
ok( $res->[0] == 200, 'Response is 200' ) or explain( $res->[0], 200 );
|
2016-11-14 13:34:46 +01:00
|
|
|
my $cookies = $client->getCookies($res);
|
2016-08-05 13:56:16 +02:00
|
|
|
my $id;
|
|
|
|
ok( $id = $cookies->{lemonldap}, 'Get cookie' )
|
|
|
|
or explain( $res, 'Set-Cookie: something' );
|
|
|
|
clean_sessions();
|
|
|
|
|
|
|
|
count(3);
|
|
|
|
done_testing( count() );
|