Add pfx tls test for tls config node

This commit is contained in:
Dave Conway-Jones 2024-10-09 21:30:28 +01:00
parent 71440be009
commit e4e3e0be7b
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643
2 changed files with 31 additions and 4 deletions

View File

@ -1802,6 +1802,33 @@ describe('HTTP Request Node', function() {
}) })
}); });
it('should use pfx tls file', function(done) {
var flow = [
{id:"n1",type:"http request",wires:[["n2"]],method:"GET",ret:"txt",url:getSslTestURLWithoutProtocol('/text'),tls:"n3"},
{id:"n2", type:"helper"},
{id:"n3", type:"tls-config", p12:"test/resources/ssl/test.pfx", verifyservercert:false}];
var testNodes = [httpRequestNode, tlsNode];
helper.load(testNodes, flow, function() {
var n3 = helper.getNode("n3");
var n2 = helper.getNode("n2");
var n1 = helper.getNode("n1");
n2.on("input", function(msg) {
try {
msg.should.have.property('payload','hello');
msg.should.have.property('statusCode',200);
msg.should.have.property('headers');
msg.headers.should.have.property('content-length',''+('hello'.length));
msg.headers.should.have.property('content-type').which.startWith('text/html');
msg.should.have.property('responseUrl').which.startWith('https://');
done();
} catch(err) {
done(err);
}
});
n1.receive({payload:"foo"});
});
});
it('should use env var http_proxy', function(done) { it('should use env var http_proxy', function(done) {
const url = getTestURL('/postInspect') const url = getTestURL('/postInspect')
const proxyUrl = "http://localhost:" + testProxyPort const proxyUrl = "http://localhost:" + testProxyPort

BIN
test/resources/ssl/test.pfx Normal file

Binary file not shown.