Not Receiving Payload From Webhook

I have created a webhook, subscribed to events (contact.creation, contact.propertyChange) and have tested it successfully using PipeDream.com. I then created a “self-signed” certificate using OpenSSL and running the NodeJs code (below) on my web server but I am not receiving any payload(s) when I change the Target URL to my URL and suffix port 8443. Do I need a “real” certificate or am I doing something else wrong? Thank you in advance for any help and/or direction.

const https = require(‘https’);

var fs = require(‘fs’);

var options = {

key: fs.readFileSync(‘./key.pem’),

cert: fs.readFileSync(‘./cert.pem’)

};

https.createServer(options,(request, response) => {

const { headers, method, url } = request;

let body = [];

request.on(‘error’, (err) => {

console.error(err);

}).on(‘data’, (chunk) => {

body.push(chunk);

}).on(‘end’, () => {

body = Buffer.concat(body).toString();

response.on(‘error’, (err) => {

console.error(err);

});

response.statusCode = 200;

response.setHeader(‘Content-Type’, ‘application/json’);

const responseBody = { headers, method, url, body };

console.log(body);

response.write(JSON.stringify(responseBody));

response.end();

});

}).listen(8443);

Hi @FBroccoli , thanks for reaching out to the HubSpot Community.

@MatthewShepherd and @PCarlson , is this topic something you’re familiar with? Would you mind sharing your advice for @FBroccoli ?

Hi @natsumimori, I was able to resolve my issue by exporting an existing CA certificate and converting it into key, cert, and bundle PEM files.

Hey @FBroccoli ,

Thank you for the follow-up and sharing the solution in the thread!