Commit cef5e14d authored by Leigh Stoller's avatar Leigh Stoller

Changed for FreeBSD 10; IO::Socket:SSL interface changed.

parent 6ff7c573
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# Copyright (c) 2008-2012 University of Utah and the Flux Group. # Copyright (c) 2008-2014 University of Utah and the Flux Group.
# #
# {{{GENIPUBLIC-LICENSE # {{{GENIPUBLIC-LICENSE
# #
...@@ -202,21 +202,33 @@ sub CallMethod($$$@) ...@@ -202,21 +202,33 @@ sub CallMethod($$$@)
#$IO::Socket::SSL::DEBUG = 4; #$IO::Socket::SSL::DEBUG = 4;
$Net::SSLeay::slowly = 1; $Net::SSLeay::slowly = 1;
if ($FBSD_MAJOR >= 10) {
IO::Socket::SSL::set_defaults('SSL_key_file' => $context->keyfile(),
'SSL_cert_file' => $context->certfile(),
'SSL_use_cert' => 1);
}
else {
$IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_key_file'} = $IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_key_file'} =
$context->keyfile(); $context->keyfile();
$IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_cert_file'} = $IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_cert_file'} =
$context->certfile(); $context->certfile();
$IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_use_cert'} = 1; $IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_use_cert'} = 1;
}
# #
# If we have a passphrase in the context, then provide a callback # If we have a passphrase in the context, then provide a callback
# to hand it back. Otherwise the user gets prompted for it. # to hand it back. Otherwise the user gets prompted for it.
# #
if (defined($context->password())) { if (defined($context->password())) {
if ($FBSD_MAJOR >= 10) {
IO::Socket::SSL::set_defaults('SSL_passwd_cb' =>
sub { return $context->password(); });
}
else {
$IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_passwd_cb'} = $IO::Socket::SSL::GLOBAL_CONTEXT_ARGS->{'SSL_passwd_cb'} =
sub { return $context->password(); }; sub { return $context->password(); };
} }
} }
}
else { else {
require Net::SSL; require Net::SSL;
require Net::HTTPS; require Net::HTTPS;
......
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