Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
argonaut
Commits
6eb87885
Commit
6eb87885
authored
Aug 25, 2015
by
Côme Bernigaud
Committed by
Benoit Mortier
Aug 25, 2015
Browse files
Fixes
#4046
argonaut-fai-monitor does not work with HTTPS
parent
218fd124
Changes
3
Hide whitespace changes
Inline
Side-by-side
argonaut-common/Argonaut/Libraries/Common.pm
View file @
6eb87885
...
...
@@ -719,6 +719,7 @@ sub argonaut_get_server_settings {
'
keyfile
'
=>
"
argonautKeyPath
",
'
certfile
'
=>
"
argonautCertPath
",
'
cacertfile
'
=>
"
argonautCaCertPath
",
'
certcn
'
=>
"
argonautCertCN
",
'
iptool
'
=>
"
argonautIpTool
",
'
delete_finished_tasks
'
=>
"
argonautDeleteFinished
",
'
fetch_packages
'
=>
"
argonautFetchPackages
",
...
...
argonaut-fai-server/bin/argonaut-fai-monitor
View file @
6eb87885
...
...
@@ -95,20 +95,10 @@ sub get_id
{
my
$host
=
shift
;
unless
(
exists
$taskids
{
$host
})
{
my
$client
;
if
(
USE_LEGACY_JSON_RPC
)
{
$client
=
new
JSON::RPC::Legacy::
Client
;
}
else
{
$client
=
new
JSON::RPC::
Client
;
}
$client
->
version
('
1.0
');
my
$callobj
=
{
method
=>
"
get_host_id
",
params
=>
[
$host
,
'
(objectClass=FAIobject)
'],
};
my
$taskid
=
$client
->
call
(
$protocol
.
"
://
"
.
$config
->
{'
server_ip
'}
.
"
:
"
.
$server_port
,
$callobj
);
my
$taskid
=
rpc_call
(
"
get_host_id
",
[
$host
,
'
(objectClass=FAIobject)
']
);
if
(
$taskid
)
{
if
(
$taskid
->
is_error
)
{
...
...
@@ -117,7 +107,7 @@ sub get_id
$taskids
{
$host
}
=
$taskid
->
content
->
{
result
};
}
}
else
{
die
"
Error while trying to contact Argonaut server
:
"
.
$client
->
status_line
.
"
\n
";
die
"
Error while trying to contact Argonaut server
\n
";
}
}
return
$taskids
{
$host
};
...
...
@@ -135,9 +125,13 @@ sub rpc_call
}
$client
->
version
('
1.0
');
if
(
$protocol
eq
'
https
')
{
#~ if ($client->ua->can('ssl_opts')) {
#~ $client->ua->ssl_opts(verify_hostname => 1, SSL_ca_file => "dummy_ca.crt");
#~ }
if
(
$client
->
ua
->
can
('
ssl_opts
'))
{
$client
->
ua
->
ssl_opts
(
verify_hostname
=>
1
,
SSL_ca_file
=>
$client_settings
->
{'
cacertfile
'},
SSL_verifycn_name
=>
$server_settings
->
{'
certcn
'}
);
}
$client
->
ua
->
credentials
(
$config
->
{'
server_ip
'}
.
"
:
"
.
$server_port
,
"
JSONRPCRealm
",
"",
argonaut_gen_ssha_token
(
$server_settings
->
{'
token
'}));
}
...
...
@@ -157,6 +151,8 @@ sub rpc_call
$log
->
error
("
Error while trying to contact Argonaut server :
"
.
$client
->
status_line
);
print
"
Error while trying to contact Argonaut server :
"
.
$client
->
status_line
.
"
\n
";
}
return
$res
;
}
sub
parse_line
...
...
argonaut-server/Argonaut/Server/Modules/Argonaut.pm
View file @
6eb87885
...
...
@@ -134,8 +134,8 @@ sub launch { # if ip pings, send the request
SSL_ca_file
=>
$self
->
{'
cacertfile
'},
SSL_verifycn_name
=>
$self
->
{'
certcn
'}
);
$client
->
ua
->
credentials
(
$ip
.
"
:
"
.
$self
->
{'
port
'},
"
JSONRPCRealm
",
"",
argonaut_gen_ssha_token
(
$self
->
{'
token
'}));
}
$client
->
ua
->
credentials
(
$ip
.
"
:
"
.
$self
->
{'
port
'},
"
JSONRPCRealm
",
"",
argonaut_gen_ssha_token
(
$self
->
{'
token
'}));
}
my
$callobj
=
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment