From 33b00dce82b7989da95beb855d71324dcbe7c5ab Mon Sep 17 00:00:00 2001 From: bhsu22 <56443547+bhsu22@users.noreply.github.com> Date: Mon, 2 Mar 2020 12:51:11 -0500 Subject: [PATCH] AddsHTTPS support for REST protocol for AWS Neptune. (#82) * adds https support for REST protocol * add https flag to graphConf --- scripts/graphConf.js | 3 +++ scripts/graphioGremlin.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/graphConf.js b/scripts/graphConf.js index 8a0b882..e565283 100644 --- a/scripts/graphConf.js +++ b/scripts/graphConf.js @@ -8,6 +8,9 @@ const host = false; // For implementations like Neptune where only single commands are allowed per request // set to true const SINGLE_COMMANDS_AND_NO_VARS = false; +// For implementations like Neptune where communication only over https is allowed +// set to true +const REST_USE_HTTPS = false; // Time out for the REST protocol. Increase it if the graphDB is slow. const REST_TIMEOUT = 2000 diff --git a/scripts/graphioGremlin.js b/scripts/graphioGremlin.js index e3f5b89..6b73d65 100644 --- a/scripts/graphioGremlin.js +++ b/scripts/graphioGremlin.js @@ -216,7 +216,11 @@ var graphioGremlin = (function(){ let server_port = $('#server_port').val(); let COMMUNICATION_PROTOCOL = $('#server_protocol').val(); if (COMMUNICATION_PROTOCOL == 'REST'){ - let server_url = "http://"+server_address+":"+server_port; + if(REST_USE_HTTPS){ + let server_url = "https://"+server_address+":"+server_port; + } else{ + let server_url = "http://"+server_address+":"+server_port; + } run_ajax_request(gremlin_query,server_url,query_type,active_node,message,callback); } else if (COMMUNICATION_PROTOCOL == 'websocket'){