From 4a7839ed347d9e60988bcbb4ab1063e19b5df319 Mon Sep 17 00:00:00 2001 From: Heshan Padmasiri Date: Thu, 3 Oct 2024 09:20:40 +0530 Subject: [PATCH 1/3] Update bal tests --- .../ballerina/bal/h1_h1_passthrough.bal | 14 ++--- .../ballerina/bal/h1_transformation.bal | 57 +++++++++---------- .../ballerina/bal/h1c_h1c_passthrough.bal | 10 ++-- .../ballerina/bal/h1c_transformation.bal | 55 ++++++++---------- .../ballerina/bal/h2_h1_passthrough.bal | 12 ++-- .../ballerina/bal/h2_h1c_passthrough.bal | 12 ++-- .../ballerina/bal/h2_h2_passthrough.bal | 12 ++-- 7 files changed, 81 insertions(+), 91 deletions(-) diff --git a/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal b/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal index 5f93c2c..be9c56b 100644 --- a/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal @@ -1,19 +1,19 @@ import ballerina/http; import ballerina/log; -listener http:Listener securedEP = new(9090, +listener http:Listener securedEP = new (9090, secureSocket = { key: { - path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", + path: "/home/ubuntu/ballerina-performance-distribution-1.1.1-SNAPSHOT/ballerinaKeystore.p12", password: "ballerina" } } ); -final http:Client nettyEP = check new("https://netty:8688", +final http:Client nettyEP = check new ("https://netty:8688", secureSocket = { cert: { - path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", + path: "/home/ubuntu/ballerina-performance-distribution-1.1.1-SNAPSHOT/ballerinaTruststore.p12", password: "ballerina" }, verifyHostName: false @@ -21,16 +21,16 @@ final http:Client nettyEP = check new("https://netty:8688", ); service /passthrough on securedEP { - resource function post .(http:Caller caller, http:Request clientRequest) { + isolated resource function post .(http:Request clientRequest) returns http:Response { http:Response|http:ClientError response = nettyEP->forward("/service/EchoService", clientRequest); if (response is http:Response) { - error? result = caller->respond(response); + return response; } else { log:printError("Error at h1_h1_passthrough", 'error = response); http:Response res = new; res.statusCode = 500; res.setPayload(response.message()); - error? result = caller->respond(res); + return res; } } } diff --git a/distribution/scripts/ballerina/bal/h1_transformation.bal b/distribution/scripts/ballerina/bal/h1_transformation.bal index d3efd33..b3d7838 100644 --- a/distribution/scripts/ballerina/bal/h1_transformation.bal +++ b/distribution/scripts/ballerina/bal/h1_transformation.bal @@ -2,7 +2,7 @@ import ballerina/http; import ballerina/log; import ballerina/xmldata; -listener http:Listener securedEP = new(9090, +listener http:Listener securedEP = new (9090, secureSocket = { key: { path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", @@ -11,7 +11,7 @@ listener http:Listener securedEP = new(9090, } ); -final http:Client nettyEP = check new("https://netty:8688", +final http:Client nettyEP = check new ("https://netty:8688", secureSocket = { cert: { path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", @@ -22,36 +22,31 @@ final http:Client nettyEP = check new("https://netty:8688", ); service /transform on securedEP { - resource function post .(http:Caller caller, http:Request req) { + isolated resource function post .(http:Request req) returns http:Response { json|error payload = req.getJsonPayload(); - if (payload is json) { - xml|xmldata:Error? xmlPayload = xmldata:fromJson(payload); - if (xmlPayload is xml) { - http:Request clinetreq = new; - clinetreq.setXmlPayload(xmlPayload); - http:Response|http:ClientError response = nettyEP->post("/service/EchoService", clinetreq); - if (response is http:Response) { - error? result = caller->respond(response); - } else { - log:printError("Error at h1_transformation", 'error = response); - http:Response res = new; - res.statusCode = 500; - res.setPayload(response.message()); - error? result = caller->respond(res); - } - } else if (xmlPayload is xmldata:Error) { - log:printError("Error at h1_transformation", 'error = xmlPayload); - http:Response res = new; - res.statusCode = 400; - res.setPayload(xmlPayload.message()); - error? result = caller->respond(res); - } - } else { - log:printError("Error at h1_transformation", 'error = payload); - http:Response res = new; - res.statusCode = 400; - res.setPayload(payload.message()); - error? result = caller->respond(res); + if payload is error { + return getErrorResponse(payload, http:STATUS_BAD_REQUEST); } + xml|xmldata:Error? xmlPayload = xmldata:fromJson(payload); + if xmlPayload is xmldata:Error? { + return getErrorResponse(xmlPayload, http:STATUS_BAD_REQUEST); + } + http:Request clinetreq = new; + clinetreq.setXmlPayload(xmlPayload); + http:Response|http:ClientError response = nettyEP->post("/service/EchoService", clinetreq); + if response is http:ClientError { + return getErrorResponse(response, http:STATUS_INTERNAL_SERVER_ERROR); + } + return response; + } +} + +isolated function getErrorResponse(error? err, int statusCode) returns http:Response { + log:printError("Error at h1_transformation", 'error = err); + http:Response res = new; + res.statusCode = statusCode; + if err != () { + res.setPayload(err.message()); } + return res; } diff --git a/distribution/scripts/ballerina/bal/h1c_h1c_passthrough.bal b/distribution/scripts/ballerina/bal/h1c_h1c_passthrough.bal index 09813cb..9845a92 100644 --- a/distribution/scripts/ballerina/bal/h1c_h1c_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h1c_h1c_passthrough.bal @@ -1,19 +1,19 @@ import ballerina/http; import ballerina/log; -final http:Client nettyEP = check new("http://netty:8688"); +final http:Client nettyEP = check new ("http://netty:8688"); service /passthrough on new http:Listener(9090) { - resource function post .(http:Caller caller, http:Request clientRequest) { + isolated resource function post .(http:Request clientRequest) returns http:Response { http:Response|http:ClientError response = nettyEP->forward("/service/EchoService", clientRequest); if (response is http:Response) { - error? result = caller->respond(response); + return response; } else { - log:printError("Error at h1c_h1c_passthrough", 'error = response); + log:printError("Error at h1_h1_passthrough", 'error = response); http:Response res = new; res.statusCode = 500; res.setPayload(response.message()); - error? result = caller->respond(res); + return res; } } } diff --git a/distribution/scripts/ballerina/bal/h1c_transformation.bal b/distribution/scripts/ballerina/bal/h1c_transformation.bal index dc839f9..14a7e38 100644 --- a/distribution/scripts/ballerina/bal/h1c_transformation.bal +++ b/distribution/scripts/ballerina/bal/h1c_transformation.bal @@ -2,39 +2,34 @@ import ballerina/http; import ballerina/log; import ballerina/xmldata; -final http:Client nettyEP = check new("http://netty:8688"); +final http:Client nettyEP = check new ("http://netty:8688"); service /transform on new http:Listener(9090) { - resource function post .(http:Caller caller, http:Request req) { + isolated resource function post .(http:Request req) returns http:Response { json|error payload = req.getJsonPayload(); - if (payload is json) { - xml|xmldata:Error? xmlPayload = xmldata:fromJson(payload); - if (xmlPayload is xml) { - http:Request clinetreq = new; - clinetreq.setXmlPayload(xmlPayload); - http:Response|http:ClientError response = nettyEP->post("/service/EchoService", clinetreq); - if (response is http:Response) { - error? result = caller->respond(response); - } else { - log:printError("Error at h1c_transformation", 'error = response); - http:Response res = new; - res.statusCode = 500; - res.setPayload(response.message()); - error? result = caller->respond(res); - } - } else if (xmlPayload is xmldata:Error) { - log:printError("Error at h1c_transformation", 'error = xmlPayload); - http:Response res = new; - res.statusCode = 400; - res.setPayload(xmlPayload.message()); - error? result = caller->respond(res); - } - } else { - log:printError("Error at h1c_transformation", 'error = payload); - http:Response res = new; - res.statusCode = 400; - res.setPayload(payload.message()); - error? result = caller->respond(res); + if payload is error { + return getErrorResponse(payload, http:STATUS_BAD_REQUEST); } + xml|xmldata:Error? xmlPayload = xmldata:fromJson(payload); + if xmlPayload is xmldata:Error? { + return getErrorResponse(xmlPayload, http:STATUS_BAD_REQUEST); + } + http:Request clinetreq = new; + clinetreq.setXmlPayload(xmlPayload); + http:Response|http:ClientError response = nettyEP->post("/service/EchoService", clinetreq); + if response is http:ClientError { + return getErrorResponse(response, http:STATUS_INTERNAL_SERVER_ERROR); + } + return response; + } +} + +isolated function getErrorResponse(error? err, int statusCode) returns http:Response { + log:printError("Error at h1_transformation", 'error = err); + http:Response res = new; + res.statusCode = statusCode; + if err != () { + res.setPayload(err.message()); } + return res; } diff --git a/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal b/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal index ce16dcb..96153b7 100644 --- a/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal @@ -1,7 +1,7 @@ import ballerina/http; import ballerina/log; -listener http:Listener securedEP = new(9090, +listener http:Listener securedEP = new (9090, httpVersion = "2.0", secureSocket = { key: { @@ -11,7 +11,7 @@ listener http:Listener securedEP = new(9090, } ); -final http:Client nettyEP = check new("https://netty:8688", +final http:Client nettyEP = check new ("https://netty:8688", secureSocket = { cert: { path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", @@ -22,16 +22,16 @@ final http:Client nettyEP = check new("https://netty:8688", ); service /passthrough on securedEP { - resource function post .(http:Caller caller, http:Request clientRequest) { + isolated resource function post .(http:Request clientRequest) returns http:Response { http:Response|http:ClientError response = nettyEP->forward("/service/EchoService", clientRequest); if (response is http:Response) { - error? result = caller->respond(response); + return response; } else { - log:printError("Error at h2_h1_passthrough", 'error = response); + log:printError("Error at h1_h1_passthrough", 'error = response); http:Response res = new; res.statusCode = 500; res.setPayload(response.message()); - error? result = caller->respond(res); + return res; } } } diff --git a/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal b/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal index 4f1c188..57d8fcb 100644 --- a/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal @@ -17,7 +17,7 @@ import ballerina/http; import ballerina/log; -listener http:Listener securedEP = new(9090, +listener http:Listener securedEP = new (9090, httpVersion = "2.0", secureSocket = { key: { @@ -27,19 +27,19 @@ listener http:Listener securedEP = new(9090, } ); -final http:Client nettyEP = check new("http://netty:8688"); +final http:Client nettyEP = check new ("http://netty:8688"); service /passthrough on securedEP { - resource function post .(http:Caller caller, http:Request clientRequest) { + isolated resource function post .(http:Request clientRequest) returns http:Response { http:Response|http:ClientError response = nettyEP->forward("/service/EchoService", clientRequest); if (response is http:Response) { - error? result = caller->respond(response); + return response; } else { - log:printError("Error at h2_h1c_passthrough", 'error = response); + log:printError("Error at h1_h1_passthrough", 'error = response); http:Response res = new; res.statusCode = 500; res.setPayload(response.message()); - error? result = caller->respond(res); + return res; } } } diff --git a/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal b/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal index c8522c2..5d57b7c 100644 --- a/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal @@ -1,7 +1,7 @@ import ballerina/http; import ballerina/log; -listener http:Listener securedEP = new(9090, +listener http:Listener securedEP = new (9090, httpVersion = "2.0", secureSocket = { key: { @@ -11,7 +11,7 @@ listener http:Listener securedEP = new(9090, } ); -final http:Client nettyEP = check new("https://netty:8688", +final http:Client nettyEP = check new ("https://netty:8688", httpVersion = "2.0", secureSocket = { cert: { @@ -23,16 +23,16 @@ final http:Client nettyEP = check new("https://netty:8688", ); service /passthrough on securedEP { - resource function post .(http:Caller caller, http:Request clientRequest) { + isolated resource function post .(http:Request clientRequest) returns http:Response { http:Response|http:ClientError response = nettyEP->forward("/service/EchoService", clientRequest); if (response is http:Response) { - error? result = caller->respond(response); + return response; } else { - log:printError("Error at h2_h2_passthrough", 'error = response); + log:printError("Error at h1_h1_passthrough", 'error = response); http:Response res = new; res.statusCode = 500; res.setPayload(response.message()); - error? result = caller->respond(res); + return res; } } } From 54ac3cf635b3ca2e393e540c6a38495642795a45 Mon Sep 17 00:00:00 2001 From: Heshan Padmasiri Date: Thu, 3 Oct 2024 09:36:44 +0530 Subject: [PATCH 2/3] Use configurables to set paths and passwords --- .../scripts/ballerina/bal/h1_h1_passthrough.bal | 12 ++++++++---- .../scripts/ballerina/bal/h1_transformation.bal | 12 ++++++++---- .../scripts/ballerina/bal/h2_h1_passthrough.bal | 13 ++++++++----- .../scripts/ballerina/bal/h2_h1c_passthrough.bal | 6 ++++-- .../scripts/ballerina/bal/h2_h2_passthrough.bal | 14 ++++++++------ .../scripts/ballerina/data_mapping/main.bal | 3 ++- 6 files changed, 38 insertions(+), 22 deletions(-) diff --git a/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal b/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal index be9c56b..51cc2a3 100644 --- a/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h1_h1_passthrough.bal @@ -1,11 +1,15 @@ import ballerina/http; import ballerina/log; +configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; +configurable string epKeyPassword = ?; + listener http:Listener securedEP = new (9090, secureSocket = { key: { - path: "/home/ubuntu/ballerina-performance-distribution-1.1.1-SNAPSHOT/ballerinaKeystore.p12", - password: "ballerina" + path: epKeyPath, + password: epKeyPassword } } ); @@ -13,8 +17,8 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("https://netty:8688", secureSocket = { cert: { - path: "/home/ubuntu/ballerina-performance-distribution-1.1.1-SNAPSHOT/ballerinaTruststore.p12", - password: "ballerina" + path: epTrustStorePath, + password: epKeyPassword }, verifyHostName: false } diff --git a/distribution/scripts/ballerina/bal/h1_transformation.bal b/distribution/scripts/ballerina/bal/h1_transformation.bal index b3d7838..af63205 100644 --- a/distribution/scripts/ballerina/bal/h1_transformation.bal +++ b/distribution/scripts/ballerina/bal/h1_transformation.bal @@ -2,11 +2,15 @@ import ballerina/http; import ballerina/log; import ballerina/xmldata; +configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; +configurable string epKeyPassword = ?; + listener http:Listener securedEP = new (9090, secureSocket = { key: { - path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", - password: "ballerina" + path: epKeyPath, + password: epKeyPassword } } ); @@ -14,8 +18,8 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("https://netty:8688", secureSocket = { cert: { - path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", - password: "ballerina" + path: epTrustStorePath, + password: epKeyPassword }, verifyHostName: false } diff --git a/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal b/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal index 96153b7..51cc2a3 100644 --- a/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h2_h1_passthrough.bal @@ -1,12 +1,15 @@ import ballerina/http; import ballerina/log; +configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; +configurable string epKeyPassword = ?; + listener http:Listener securedEP = new (9090, - httpVersion = "2.0", secureSocket = { key: { - path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", - password: "ballerina" + path: epKeyPath, + password: epKeyPassword } } ); @@ -14,8 +17,8 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("https://netty:8688", secureSocket = { cert: { - path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", - password: "ballerina" + path: epTrustStorePath, + password: epKeyPassword }, verifyHostName: false } diff --git a/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal b/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal index 57d8fcb..af21675 100644 --- a/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h2_h1c_passthrough.bal @@ -17,12 +17,14 @@ import ballerina/http; import ballerina/log; +configurable string epTrustStorePath = ?; +configurable string epKeyPassword = ?; listener http:Listener securedEP = new (9090, httpVersion = "2.0", secureSocket = { key: { - path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", - password: "ballerina" + path: epTrustStorePath, + password: epKeyPassword } } ); diff --git a/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal b/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal index 5d57b7c..51cc2a3 100644 --- a/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal +++ b/distribution/scripts/ballerina/bal/h2_h2_passthrough.bal @@ -1,22 +1,24 @@ import ballerina/http; import ballerina/log; +configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; +configurable string epKeyPassword = ?; + listener http:Listener securedEP = new (9090, - httpVersion = "2.0", secureSocket = { key: { - path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", - password: "ballerina" + path: epKeyPath, + password: epKeyPassword } } ); final http:Client nettyEP = check new ("https://netty:8688", - httpVersion = "2.0", secureSocket = { cert: { - path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", - password: "ballerina" + path: epTrustStorePath, + password: epKeyPassword }, verifyHostName: false } diff --git a/distribution/scripts/ballerina/data_mapping/main.bal b/distribution/scripts/ballerina/data_mapping/main.bal index b922b09..e62f8a1 100644 --- a/distribution/scripts/ballerina/data_mapping/main.bal +++ b/distribution/scripts/ballerina/data_mapping/main.bal @@ -17,6 +17,7 @@ import ballerina/http; configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; configurable string epKeyPassword = ?; type Order record {| @@ -55,7 +56,7 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("netty:8688", secureSocket = { cert: { - path: epKeyPath, + path: epTrustStorePath, password: epKeyPassword }, verifyHostName: false From cf8ebde283800951d51ca18dea6dc84e344749a2 Mon Sep 17 00:00:00 2001 From: Heshan Padmasiri Date: Thu, 3 Oct 2024 09:46:32 +0530 Subject: [PATCH 3/3] Update new tests --- .../scripts/ballerina/content_based_routing/main.bal | 3 ++- .../scripts/ballerina/json_xml_transformation/main.bal | 5 +++-- distribution/scripts/ballerina/secured_passthrough/main.bal | 3 ++- distribution/scripts/ballerina/service_chaining/main.bal | 3 ++- .../scripts/ballerina/xml_csv_transformation/main.bal | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/distribution/scripts/ballerina/content_based_routing/main.bal b/distribution/scripts/ballerina/content_based_routing/main.bal index 172d983..ab04036 100644 --- a/distribution/scripts/ballerina/content_based_routing/main.bal +++ b/distribution/scripts/ballerina/content_based_routing/main.bal @@ -18,6 +18,7 @@ import ballerina/data.jsondata; import ballerina/http; configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; configurable string epKeyPassword = ?; listener http:Listener securedEP = new (9090, @@ -32,7 +33,7 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("netty:8688", secureSocket = { cert: { - path: epKeyPath, + path: epTrustStorePath, password: epKeyPassword }, verifyHostName: false diff --git a/distribution/scripts/ballerina/json_xml_transformation/main.bal b/distribution/scripts/ballerina/json_xml_transformation/main.bal index ed8cb3c..ac871de 100644 --- a/distribution/scripts/ballerina/json_xml_transformation/main.bal +++ b/distribution/scripts/ballerina/json_xml_transformation/main.bal @@ -14,10 +14,11 @@ // specific language governing permissions and limitations // under the License. -import ballerina/http; import ballerina/data.xmldata; +import ballerina/http; configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; configurable string epKeyPassword = ?; listener http:Listener securedEP = new (9090, @@ -32,7 +33,7 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("netty:8688", secureSocket = { cert: { - path: epKeyPath, + path: epTrustStorePath, password: epKeyPassword }, verifyHostName: false diff --git a/distribution/scripts/ballerina/secured_passthrough/main.bal b/distribution/scripts/ballerina/secured_passthrough/main.bal index ca01297..132a9fb 100644 --- a/distribution/scripts/ballerina/secured_passthrough/main.bal +++ b/distribution/scripts/ballerina/secured_passthrough/main.bal @@ -17,6 +17,7 @@ import ballerina/http; configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; configurable string epKeyPassword = ?; listener http:Listener securedEP = new (9090, @@ -31,7 +32,7 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("netty:8688", secureSocket = { cert: { - path: epKeyPath, + path: epTrustStorePath, password: epKeyPassword }, verifyHostName: false diff --git a/distribution/scripts/ballerina/service_chaining/main.bal b/distribution/scripts/ballerina/service_chaining/main.bal index dcf9848..98818d8 100644 --- a/distribution/scripts/ballerina/service_chaining/main.bal +++ b/distribution/scripts/ballerina/service_chaining/main.bal @@ -22,6 +22,7 @@ type Response record {| |}; configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; configurable string epKeyPassword = ?; listener http:Listener securedEP = new (9090, @@ -36,7 +37,7 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("netty:8688", secureSocket = { cert: { - path: epKeyPath, + path: epTrustStorePath, password: epKeyPassword }, verifyHostName: false diff --git a/distribution/scripts/ballerina/xml_csv_transformation/main.bal b/distribution/scripts/ballerina/xml_csv_transformation/main.bal index 2ed9950..b4cef43 100644 --- a/distribution/scripts/ballerina/xml_csv_transformation/main.bal +++ b/distribution/scripts/ballerina/xml_csv_transformation/main.bal @@ -18,6 +18,7 @@ import ballerina/data.xmldata; import ballerina/http; configurable string epKeyPath = ?; +configurable string epTrustStorePath = ?; configurable string epKeyPassword = ?; type Order record {| @@ -43,7 +44,7 @@ listener http:Listener securedEP = new (9090, final http:Client nettyEP = check new ("netty:8688", secureSocket = { cert: { - path: epKeyPath, + path: epTrustStorePath, password: epKeyPassword }, verifyHostName: false