predefine ssl version when verify or activate license
This commit is contained in:
@@ -45,7 +45,7 @@ class License
|
|||||||
##change the d/e key
|
##change the d/e key
|
||||||
# @options = { query: {device: "SXlite", lookup: lookup, skey: @secret, token: SECRETS_CONFIG['provision_key']} }
|
# @options = { query: {device: "SXlite", lookup: lookup, skey: @secret, token: SECRETS_CONFIG['provision_key']} }
|
||||||
@params = { query: { lookup_type: self.server_mode, lookup: lookup, iv_key: aes_iv} }
|
@params = { query: { lookup_type: self.server_mode, lookup: lookup, iv_key: aes_iv} }
|
||||||
response = self.class.get("/subdomain", @params)
|
response = self.class.get("/subdomain", @params.merge(get_predefined_ssl_version))
|
||||||
@license = response.parsed_response
|
@license = response.parsed_response
|
||||||
Rails.logger.info "License Response - " + response.parsed_response.to_s
|
Rails.logger.info "License Response - " + response.parsed_response.to_s
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class License
|
|||||||
@params = { query: { lookup_type: self.server_mode, iv_key: aes_iv, license_key: license_key } }
|
@params = { query: { lookup_type: self.server_mode, iv_key: aes_iv, license_key: license_key } }
|
||||||
|
|
||||||
begin
|
begin
|
||||||
response = self.class.get("/activate", @params)
|
response = self.class.get("/activate", @params.merge(get_predefined_ssl_version))
|
||||||
@activate = response.parsed_response
|
@activate = response.parsed_response
|
||||||
|
|
||||||
if (@activate["status"])
|
if (@activate["status"])
|
||||||
@@ -153,7 +153,7 @@ class License
|
|||||||
@params = { query: {lookup_type: "application", api_token: api_token} }
|
@params = { query: {lookup_type: "application", api_token: api_token} }
|
||||||
|
|
||||||
begin
|
begin
|
||||||
response = self.class.get("/verify", @params)
|
response = self.class.get("/verify", @params.merge(get_predefined_ssl_version))
|
||||||
@varified = response.parsed_response
|
@varified = response.parsed_response
|
||||||
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
|
||||||
if (@varified["status"])
|
if (@varified["status"])
|
||||||
@@ -220,7 +220,7 @@ class License
|
|||||||
aes_key, aes_iv = aes.export_key(lookup)
|
aes_key, aes_iv = aes.export_key(lookup)
|
||||||
|
|
||||||
params = { query: { lookup_type: "cloud", lookup: lookup, iv_key: aes_iv} }
|
params = { query: { lookup_type: "cloud", lookup: lookup, iv_key: aes_iv} }
|
||||||
response = self.class.get("/subdomain", params)
|
response = self.class.get("/subdomain", params.merge(get_predefined_ssl_version))
|
||||||
response.parsed_response["status"]
|
response.parsed_response["status"]
|
||||||
rescue
|
rescue
|
||||||
end
|
end
|
||||||
@@ -298,7 +298,7 @@ class License
|
|||||||
api_token = read_license_no_decrypt("api_token")
|
api_token = read_license_no_decrypt("api_token")
|
||||||
shop_name = read_license_no_decrypt("shop_name")
|
shop_name = read_license_no_decrypt("shop_name")
|
||||||
@params = { query: {lookup_type: "application", api_token: api_token } }
|
@params = { query: {lookup_type: "application", api_token: api_token } }
|
||||||
response = self.class.get("/get_key", @params)
|
response = self.class.get("/get_key", @params.merge(get_predefined_ssl_version))
|
||||||
@data = response.parsed_response
|
@data = response.parsed_response
|
||||||
|
|
||||||
if (@data["status"])
|
if (@data["status"])
|
||||||
@@ -533,4 +533,13 @@ class License
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def get_predefined_ssl_version
|
||||||
|
{
|
||||||
|
verify: true,
|
||||||
|
ssl_version: :TLSv1_2
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user