0

I have a AWS-Lambda function that gots triggered after a file was placed into an S3-Bucket.

This is my lambda-function:

var http = require('http');

exports.handler = function (event, context) {

 var bucket = event.Records[0].s3.bucket.name;
 var key = event.Records[0].s3.object.key;

 var newKey = key.split('.')[0].slice(8);

 var url = 'https://xxxxx.herokuapp.com/api/messages/'+newKey+'/processingFinished'
 console.log("URL:" + url)

  http.get(url, function (result) {
    console.log('!!!! Success, with: ' + result.statusCode);
    context.done(null);
  }).on('error', function (err) {
    console.log('Error, with: ' + err.message);
    context.done("Failed");
  });
};

In CloudWatch Logfiles i see complaints that https is not supported:

2017-07-27T10:38:04.735Z    8428136e-72b7-11e7-a5b9-bd0562c862a0    Error: Protocol "https:" not supported. Expected "http:"
at new ClientRequest (_http_client.js:54:11)
at Object.exports.request (http.js:31:10)
at Object.exports.get (http.js:35:21)
at exports.handler (/var/task/index.js:18:8)

But the listed URL can be opened with any webbrowser. The Server accepts SSL and the whole API is working per SSL.

Why is AWS denying SSL-Requests? How to solve this?

1 Answer 1

2

Per the node documentation: (https://nodejs.org/api/https.html)

HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a separate module.

Use

http = require('https');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.