Skip to content

Commit

Permalink
Add cert deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaiyarasiganeshalingam committed Oct 29, 2024
1 parent 9a6747d commit f31d090
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ private SSLContext createSSLContext(OMElement keyStoreElt, OMElement trustStoreE
if (log.isDebugEnabled()) {
log.debug(name + " Loading Trust Keystore from : " + location);
}

SslSenderTrustStoreHolder.getInstance().setLocation(location);
SslSenderTrustStoreHolder.getInstance().setPassword(passwordElement.getText());
SslSenderTrustStoreHolder.getInstance().setType(type);
trustStore.load(fis, storePassword.toCharArray());
TrustManagerFactory trustManagerfactory = TrustManagerFactory.getInstance(
TrustManagerFactory.getDefaultAlgorithm());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.apache.synapse.transport.nhttp.config;

/**
* A SSL Sender TrustStore Holder class to store the client trust store's configurable details.
*/
public class SslSenderTrustStoreHolder {

private static volatile SslSenderTrustStoreHolder instance;

private SslSenderTrustStoreHolder() {}

private String location;
private String password;
private String type;

public static SslSenderTrustStoreHolder getInstance() {

if (instance == null) {
synchronized (TrustStoreHolder.class) {
if (instance == null) {
instance = new SslSenderTrustStoreHolder();
}
}
}
return instance;
}

public void setLocation(String location) {
this.location = location;
}

public String getLocation() {
return this.location;
}

public void setPassword(String password) {
this.password = password;
}

public String getPassword() {
return this.password;
}

public void setType(String type) {
this.type = type;
}

public String getType() {
return this.type;
}
}

0 comments on commit f31d090

Please sign in to comment.