- WSO2 Api Manager is changing the "javax.net.ssl.trustStore" and password to their custom location, reference: /deployment/repository/conf/TrustStore/Location/carbon.xml
- First you need to merge the backend site certificate key with wso2 trust store. referecne: "InstallCert.java"
Command used to
merge jssecacerts content to client-truststore.jks,
keytool
-importkeystore -noprompt -srckeystore client-truststore.jks -destkeystore
jssecacerts
Destination file
pw:*******
Source file pw:
changeit
- Still if you are getting error like "host is unknown" or similar kind of, change the confiuration to "Allow All" in "/deployment/repository/conf/axis2/axis2.xml"
- Then you can add your modify headers inside APIAuthenticationHandler.java
org.apache.axis2.context.MessageContext axis2MC = ((Axis2MessageContext) messageContext).
getAxis2MessageContext();
Map<String, String> headers =
(Map) axis2MC.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
headers.put("customHeader1", "customHeader1Val");
headers.put("customHeader2", "customHeader2Val");
axis2MC.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, headers);
messageContext.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, headers);
getAxis2MessageContext();
Map<String, String> headers =
(Map) axis2MC.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
headers.put("customHeader1", "customHeader1Val");
headers.put("customHeader2", "customHeader2Val");
axis2MC.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, headers);
messageContext.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, headers);
wow informative.keep up the good work
ReplyDelete