Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

feature: Make it possible to use HTTPS #19

Open
dqvn opened this issue Mar 23, 2018 · 3 comments
Open

feature: Make it possible to use HTTPS #19

dqvn opened this issue Mar 23, 2018 · 3 comments

Comments

@dqvn
Copy link

dqvn commented Mar 23, 2018

Dear,

Please help/show me how to add more configuration in order to run this server under Https with SSL
I am using your project, but we need to switch it to HTTPS rather than current normal HTTP.

Best regards,
Quang Nguyen
dqvn2002@gmail.com

@mischah
Copy link
Member

mischah commented Mar 24, 2018

Hej @dqvn,

you need to provide tls options over here:

connections: [{
port: Config.get('/port/web'),
labels: ['web']
}],

like described here.

Cheers, Michael


Going to leave this open, because it might be a feature which others may also need.

We could make this configurable via https://github.com/micromata/http-fake-backend/blob/master/.env

@mischah mischah changed the title How can we move the current server to use HTTPS (SSL) feature: Make it possible to use HTTPS Mar 24, 2018
@taumartin
Copy link

Hi, would it be too much to ask you to show me a more detailed example of what the manifest file would look like? Thanks in advance.

@mppperez
Copy link
Contributor

mppperez commented Nov 1, 2021

Hi @taumartin,

a little bit late but this may help someone else:

you have to add tls in connections (see above) with specifying the private key and certificate (chain). I had to add the encoding as well since otherwise I got an exception due to invalid format.

Example:

connections: [{
        port: Config.get('/port/web'),
        labels: ['web'],
        tls: {
            key: fs.readFileSync('/path/to/your/certs/key.pem', 'utf8'),
            cert: fs.readFileSync('/path/to/your/certs/cert.pem', 'utf8')
        }
    }],

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

No branches or pull requests

4 participants