predefine ssl version when verify or activate license

This commit is contained in:
Kaung Sint Ko Ko
2024-07-09 14:48:18 +06:30
parent b4845622a5
commit 2350d10f70

View File

@@ -45,7 +45,7 @@ class License
##change the d/e 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} }
response = self.class.get("/subdomain", @params)
response = self.class.get("/subdomain", @params.merge(get_predefined_ssl_version))
@license = response.parsed_response
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 } }
begin
response = self.class.get("/activate", @params)
response = self.class.get("/activate", @params.merge(get_predefined_ssl_version))
@activate = response.parsed_response
if (@activate["status"])
@@ -153,7 +153,7 @@ class License
@params = { query: {lookup_type: "application", api_token: api_token} }
begin
response = self.class.get("/verify", @params)
response = self.class.get("/verify", @params.merge(get_predefined_ssl_version))
@varified = response.parsed_response
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
if (@varified["status"])
@@ -220,7 +220,7 @@ class License
aes_key, aes_iv = aes.export_key(lookup)
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"]
rescue
end
@@ -298,7 +298,7 @@ class License
api_token = read_license_no_decrypt("api_token")
shop_name = read_license_no_decrypt("shop_name")
@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
if (@data["status"])
@@ -533,4 +533,13 @@ class License
end
end
private
def get_predefined_ssl_version
{
verify: true,
ssl_version: :TLSv1_2
}
end
end