I have a project with microservices deployed in Bluemix with Docker containers. All microservices are written in Java and the communication is using JKS files.
I also developed a microservice in Node.js with Express.js. To consume the other microservices, I used the Request module with option.agentOptions
feature and a pfx file
, like this:
var options = {
uri: config.get("https://www.example.com/ms/service"),
method: 'POST',
body: data,
json: true,
headers: {
'Content-Type': 'application/json; charset=UTF-8'
},
agentOptions: {
pfx: fs.readFileSync(config.get("/path/to/file.pfx")),
passphrase: config.get("passphraseText"),
servername: config.get("serverName")
}
};
request(options, function (error, response, data) {
//handing response
});
I tried to use the Solicit crate with default example for HTTPS but it fails with:
4 | use solicit::http::client::tls::TlsConnector;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `tls` in `client`
I couldnt find another crate, library or framework for made it, how can I make this requests?
EDIT
Apparently Solicit isn't an alternative for its lack of maintenance so it is no longer an alternative solution to this question, Here's the reason.