mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-13 13:17:39 +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
|
||||
server_auth = ServerAuth.new
|
||||
dsecret = Base64::decode64(secret)
|
||||
|
||||
rc = server_auth.authenticate(user, pass, secret)
|
||||
rc = server_auth.authenticate(user, pass, dsecret)
|
||||
rescue => e
|
||||
OpenNebula.error_message e.message
|
||||
exit -1
|
||||
|
@ -18,18 +18,6 @@ require 'openssl'
|
||||
require 'base64'
|
||||
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'
|
||||
|
||||
# Server authentication class. This authmethod can be used by opennebula services
|
||||
@ -65,10 +53,8 @@ class ServerAuth < X509Auth
|
||||
end
|
||||
|
||||
begin
|
||||
certs = Array.new
|
||||
certs[0] = File.read(@options[:host_cert])
|
||||
|
||||
key = File.read(@options[:host_key])
|
||||
certs = [ File.read(@options[:one_cert]) ]
|
||||
key = File.read(@options[:one_key])
|
||||
|
||||
super(:certs_pem => certs,
|
||||
:key_pem => key,
|
||||
|
Loading…
Reference in New Issue
Block a user