mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-27 14:03:40 +03:00
feature #754: Fix bugs for server authN
This commit is contained in:
parent
bbe32d8375
commit
48c0e06544
@ -39,8 +39,9 @@ secret = ARGV[2] # Base64 encoded secret as obtained from login_token
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
server_auth = ServerAuth.new
|
server_auth = ServerAuth.new
|
||||||
|
dsecret = Base64::decode64(secret)
|
||||||
|
|
||||||
rc = server_auth.authenticate(user, pass, secret)
|
rc = server_auth.authenticate(user, pass, dsecret)
|
||||||
rescue => e
|
rescue => e
|
||||||
OpenNebula.error_message e.message
|
OpenNebula.error_message e.message
|
||||||
exit -1
|
exit -1
|
||||||
|
@ -18,18 +18,6 @@ require 'openssl'
|
|||||||
require 'base64'
|
require 'base64'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
|
|
||||||
ONE_LOCATION=ENV["ONE_LOCATION"]
|
|
||||||
|
|
||||||
if !ONE_LOCATION
|
|
||||||
RUBY_LIB_LOCATION="/usr/lib/one/ruby"
|
|
||||||
ETC_LOCATION="/etc/one/"
|
|
||||||
else
|
|
||||||
RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby"
|
|
||||||
ETC_LOCATION=ONE_LOCATION+"/etc/"
|
|
||||||
end
|
|
||||||
|
|
||||||
$: << RUBY_LIB_LOCATION
|
|
||||||
|
|
||||||
require 'x509_auth'
|
require 'x509_auth'
|
||||||
|
|
||||||
# Server authentication class. This authmethod can be used by opennebula services
|
# Server authentication class. This authmethod can be used by opennebula services
|
||||||
@ -65,10 +53,8 @@ class ServerAuth < X509Auth
|
|||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
certs = Array.new
|
certs = [ File.read(@options[:one_cert]) ]
|
||||||
certs[0] = File.read(@options[:host_cert])
|
key = File.read(@options[:one_key])
|
||||||
|
|
||||||
key = File.read(@options[:host_key])
|
|
||||||
|
|
||||||
super(:certs_pem => certs,
|
super(:certs_pem => certs,
|
||||||
:key_pem => key,
|
:key_pem => key,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user