Issue:
Unable to connect to a SSL Endpoint using connector execute in ballerina. Following error is generated when try to run a such a code.

Sample Code:
Following is the sample used to test this issue.
import ballerina.net.http;
function main (string[] args) {
http:ClientConnector __endpoint1
= create http:ClientConnector("https://www.mocky.io/v2/59ed83823300004e00b5c5de/test",{ssl: {trustStoreFile:"<HOME>/bre/securitywso2carbon.jks",keyStorePassword:"wso2carbon",sslEnabledProtocols:"TLSv1.2,TLSv1.1",ciphers:"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",sslProtocol:"TLSv1.2,TLSv1.1"}});
var var1 = __endpoint1.execute("GET","",{});
println(var1);
}
For tracking purposes adding a issue from composer side: https://github.com/ballerinalang/composer/issues/4259
Not exactly related to this issue, but, how relevant is the error message given? IIUC, the purpose of the Ballerina error message printed to the console is to give the user enough information to understand what went wrong and the user should be able to correct it themselves. But this does not look like an issue that a user can resolve. The error message directly exposes Java level implementation info. This looks like a case where an internal error occurred message should've been printed and the detailed error logged to the BRE log. What do you think? @shafreenAnfar @chamil321 @irunika
@pubudu91 Thank you for the raised concern. Actually the error "Failed to initialize the server-side SSLContext" is thrown due user errors. For example, KeyStoreException, IOException, UnrecoverableKeyException .... are some of the caught exceptions. So the user can recover from them. I agree with restricting java level implementation info and this doesn't provide such info.
@NipunaMarcus I tested this issue with ballerina 0.95.0 version and it works fine. Following is the tested program according to the new API change
function main (string[] args) {
endpoint<http:HttpClient> __endpoint1 {
create http:HttpClient("https://www.mocky.io/v2/59ed83823300004e00b5c5de/test",{ssl: {trustStoreFile:"<HOME>/bre/securitywso2carbon.jks",keyStorePassword:"wso2carbon",sslEnabledProtocols:"TLSv1.2,TLSv1.1",ciphers:"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",sslProtocol:"TLSv1.2,TLSv1.1"}});
}
var var1,_ = __endpoint1.execute("GET","",{});
println(var1);
}
@chamil321 I tested this with the new implementation of endpoint using the same example and now this program returns null instead of the previously mentioned error which is the correct response hence closing this issue.