Commit 6bd2cfe3 authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '5750-possibility-to-modify-peer_name' into '1.4-dev'

Resolve "Possibility to modify peer_name"

See merge request argonaut/argonaut!130
parents 68b3b202 e50519e7
......@@ -635,6 +635,8 @@ sub argonaut_read_config {
$res{'rest_ldap'} = trim($config->val( rest => "ldap", ""));
$res{'rest_login'} = trim($config->val( rest => "login", ""));
$res{'rest_password'} = trim($config->val( rest => "password", ""));
$res{'rest_cacertfile'} = trim($config->val( rest => "ca_file", ""));
$res{'rest_certcn'} = trim($config->val( rest => "cert_cn", ""));
if ($res{'ldap_tls'} !~ m/^off|on$/i) {
warn "Unknown value for option ldap/tls: ".$res{'ldap_tls'}." (valid values are on/off)\n";
......
......@@ -44,7 +44,19 @@ sub argonaut_get_rest_client {
my $config = argonaut_read_config;
my $client = REST::Client->new();
$client->setHost($config->{'rest_endpoint'});
if ($client->getUseragent()->can('ssl_opts')) {
$client->getUseragent()->ssl_opts(verify_hostname => 1);
if ($config->{'rest_cacertfile'} ne '') {
$client->getUseragent()->ssl_opts(SSL_ca_file => $config->{'rest_cacertfile'});
}
if ($config->{'rest_certcn'} ne '') {
$client->getUseragent()->ssl_opts(SSL_verifycn_name => $config->{'rest_certcn'});
}
}
my %postBody = (
'user' => $config->{'rest_login'},
'password' => $config->{'rest_password'}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment