hapijs / glue

Server composer for hapi.js
Other
245 stars 62 forks source link

TLS/SSL question #46

Closed osukaa closed 8 years ago

osukaa commented 8 years ago

Hi,

I'm configuring connections like this, but hapi is not creating an https listener correctly.

const tlsOptions = {
    key: Fs.readFileSync(process.env.TLS_KEY),
    cert: Fs.readFileSync(process.env.TLS_CERTIFICATE)
};

connections: [
        {
            port: 1111,
            labels: ['service-proxy']
        },
        {
            port: process.env.HOST_PORT,
            labels: ['http']
        },
        {
            port: process.env.TLS_PORT,
            tls: tlsOptions,
            labels: ['https']
        }
    ]

I have no problem when setting the connection manually:

'use strict';
const Fs = require('fs');
const Hapi = require('hapi');

const tlsOptions = {
    key: Fs.readFileSync('./ssl/selfsigned_server_key.pem'),
    cert: Fs.readFileSync('./ssl/selfsigned_server_cert.pem')
};

// Create a server with a host and port
const server = new Hapi.Server();
server.connection({
    host: 'localhost',
    port: 8000,
    tls: tlsOptions
});
osukaa commented 8 years ago

It's an issue with confidence! sorry :)

penumakauday commented 8 years ago

Hi, I am also facing the same issue. If it got fixed could you please tell me the solution.

CodestarGames commented 7 years ago

Yeah I am also having trouble with this, I'm going to have to migrate away from glue if it can't support configuring the tls object in it's config. Is there any possible way to move forward, like injecting it after the fact? I have an app that has to have all of the api endpoints served over https.

Marsup commented 7 years ago

As far as I can see, this issue has be closed as not being an issue with glue but with other modules, so telling you have the same issue doesn't say much, you'll need to provide much more details to get help.

quapaw commented 7 years ago

I can't find any examples of configuring tls via a manifest. All examples have loading the key and cert files in code and not pointing to them in configuration. Have I missed something

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.