Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing certificate url #90

Open
pgbladeqcode opened this issue May 17, 2017 · 10 comments
Open

missing certificate url #90

pgbladeqcode opened this issue May 17, 2017 · 10 comments
Labels

Comments

@pgbladeqcode
Copy link

pgbladeqcode commented May 17, 2017

Hi,

every i time i start my server i get the following error:
{"status":"failure","reason":"missing certificate url"}

I tried it with a self signed certificat and altough with an existing wildcard certificat from my domain.
Whats wrong there ?

I've tried altough the old version 2.3.1 (as mentioned in another issue) , but i get the same error.

Here are my settings:

var AlexaAppServer = require("alexa-app-server");

AlexaAppServer.start({
  server_root: __dirname,
  port: 83,
  debug:false,
  verify:true,
  log : true,
  // Use preRequest to load user data on each request and add it to the request json.
  // In reality, this data would come from a db or files, etc.
  preRequest: function(json, req, res) {
    console.log("preRequest fired");
    json.userDetails = { "name": "Bob Smith" };
  },
  // Add a dummy attribute to the response
  postRequest: function(json, req, res) {
    console.log("JKO");
    json.dummy = "text";
  },

    httpsEnabled: true,

    // The https port the server will bind to. Required for httpsEnabled support.
    // Default is undefined.
    httpsPort: 8181,

    // The private key filename. This file must reside in the sslcert folder under the
    // root of the project. Default is undefined.
    privateKey: 'key.key',

    // The certificate filename. This file must reside in the sslcert folder under the root of the
    // project. Default is undefined.
    certificate: 'crt.crt',

    bundle: 'ca.crt'
});

@dblock
Copy link
Collaborator

dblock commented May 17, 2017

Do you get this error when you make a manual request or one from the alexa test UI or an actual device?

This error comes from alexa-verifier, that means the request is missing the URL, not the server. When you enable verify: true in the configuration above it will ensure that the request comes form the alexa platform. For development set it to false.

Does this help?

@pgbladeqcode
Copy link
Author

Hey thanks for your answer.
It's working with "verify:false", but it should work with my Amazon Developer Console , so i switch the parameter to true. (Manuel request say:{"status":"failure","reason":"missing certificate url"})

Whatever i do with my developer console at amazon i get this error "The remote endpoint could not be called, or the response it returned was invalid." .. but i can call the domain from all devices / smartphones etc.. with no SSL - Error or something.
Thanks !

@dblock
Copy link
Collaborator

dblock commented May 17, 2017

Can you curl your SSL endpoint successfully with SSL enabled with your certificate and verify: true?

@dblock
Copy link
Collaborator

dblock commented May 17, 2017

Have you uploaded the self-signed certificate to AWS? See https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/testing-an-alexa-skill#testing-a-web-service under "SSL Certificate":

SSL Certificate: Select one of the options. If you want to use a self-signed SSL certificate for testing, create that certificate and upload it to the Developer Portal. See Configuring Your Web Service to Use a Self-Signed Certificate.

Once you get it working, maybe contribute a note to the README, this wasn't clear for me when I re-read it.

@pgbladeqcode
Copy link
Author

Yes i can do it with a REST Tool or with the browser successfully. It's not a self signed certificate ... :( It's a wildcard SSL

@dblock
Copy link
Collaborator

dblock commented May 17, 2017

Anything in the server-side logs? Do you see the request actually making it through? Maybe another error?

Assuming the skill works without SSL from the amazon test tools, the problem must be SSL / the certificate.

So I would check with a few browsers/curl in case there's some kind of warning about the certificate (eg. an intermediate certificate is not present), and then I am out of ideas, I would ask an Amazon forum.

@pgbladeqcode
Copy link
Author

Thank you ! .. It won't work from amazon, only from "manuel calling" the Server (SSL/NON-SSL)... Is there a way to create an access log for AlexaAppServer ? So i can log the connections to the server ?
Thanks

@dblock
Copy link
Collaborator

dblock commented May 17, 2017

It depends how/where you deploy your alexa-app-server, but you should be seeing the same express log as you see locally.

@pgbladeqcode
Copy link
Author

pgbladeqcode commented May 17, 2017

The problem is, if i use an alexa app eg. https://xxxx:8181/alexa/hello_world i get no response (locally / amazon) in the server console, maybe its a problem with the port 8181 ? .. :(

Update: I tried it on an AWS Virtual machine .. works .. (not lambda, debian VPS)
But only with Port 443 .. Maybe there is the issue ?!

Update 2: Works fine with port 443 locally... very strange !

@ericblade
Copy link

Perhaps the Alexa end-point doesn't support port specifier? Or you have a firewall blocking ?

Here's a little snippet that I use to make sure that I can see what's going on on my server:

// simple request url logger

module.exports = (express, alexaAppServer) => {
    express.use('/', (req, res, next) => {
        if (req.connection.ssl) {
            console.warn('**** server: ssl request', req.url);
            next();
        } else {
            console.warn('**** server: non-ssl request', req.url);
            next();
        }
    });
};

I put this in the directory that is specified by server_dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants