Commit 9ee153ad authored by Roque's avatar Roque

solving http request issue due to frontend ciphers

- see #1
parent 15ea30c8
#! /usr/bin/env bash
DOWN_URL='https://softinst104003.host.vifib.net/erp5/'
ING_URL='https://softinst104003.host.vifib.net/erp5/portal_ingestion_policies/wendelin_embulk'
DOWN_URL='https://softinst104003.lhost.vifib.net/erp5/'
ING_URL='https://softinst104003.lhost.vifib.net/erp5/portal_ingestion_policies/wendelin_embulk'
EBULK_VERSION="0.9.7"
EBULK_DATA_PATH=~/.ebulk
......
......@@ -36,7 +36,7 @@ class WendelinClient
checkReferenceChars(reference)
uri = URI(URI.escape("#{@erp5_url}/ingestionReferenceExists?reference=#{reference}"))
begin
res = open(uri, http_basic_authentication: [@user, @password]).read
response = handleRequest(uri)
rescue Exception => e
@logger.error("An error occurred while checking if reference exists: " + e.to_s)
@logger.error(e.backtrace)
......@@ -45,7 +45,7 @@ class WendelinClient
end
return FALSE
else
return res.to_s == 'TRUE'
return response.to_s == 'TRUE'
end
end
......@@ -79,7 +79,7 @@ class WendelinClient
@logger.info("Increasing dataset version")
begin
uri = URI(URI.escape("#{@erp5_url}/ERP5Site_increaseDatasetVersion?reference=#{reference}"))
res = open(uri, http_basic_authentication: [@user, @password]).read
response = handleRequest(uri)
rescue Exception => e
@logger.error("An error occurred while increasing dataset version: " + e.to_s)
@logger.error(e.backtrace)
......@@ -151,7 +151,7 @@ class WendelinClient
n_retry = 0
while ! success && n_retry < 10
begin
res = open(uri, http_basic_authentication: [@user, @password]) {
res = open(uri, http_basic_authentication: [@user, @password], ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE) {
|content|
chunk = content.read()
if chunk.nil? || chunk.empty?
......@@ -198,7 +198,6 @@ class WendelinClient
def handleRequest(uri, reference=nil, data_chunk=nil)
req = Net::HTTP::Post.new(uri)
req.basic_auth @user, @password
if data_chunk != nil
@logger.info("Setting request form data...", print=TRUE) if reference != nil
begin
......
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