Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

HTTPS support for C9 #229

Closed
avgcoderlife opened this issue Dec 28, 2015 · 3 comments
Closed

HTTPS support for C9 #229

avgcoderlife opened this issue Dec 28, 2015 · 3 comments

Comments

@avgcoderlife
Copy link

Hello

First of all thanks to for the superb cloud IDE :)

I want to enable HTTPS support for the IDE. i.e, load the C9 IDE in HTTPS mode
I tried a lot searching for options/settings to do so but I am not able to find any such option :(
I did find some crt/key settings in one of node modules but no sure how to pass the values to them.

Is there any way to enable HTTPS for c9 IDE ? I have the .crt and .key files ready but don't know how to configure the server.js/standalone config file to use HTTPS.

@flackr
Copy link

flackr commented Jan 5, 2016

I'm not sure what the proper way to pass the options through is (i.e. it seems like you should be able to set these in config.secure in settings/standalone.js but I was unable to get this working), but I was able to hack this in by adding the following to node_modules/connect-architect/connect/connect-plugin.js:

At the top of the file add the following includes:

var fs = require("fs");
var constants = require("constants");

Immediately before the check if (options.secure) { add the following to set this setting:

options.secure = {
    ca: fs.readFileSync('/path/to/ca.crt'),
    key: fs.readFileSync('/path/to/secret.key'),
    cert: fs.readFileSync('/path/to/cert.crt'),
    dhparam: fs.readFileSync('/path/to/dh2048.pem'),
    ciphers: 'AESGCM:ECDH:HIGH:!DH:!RSA+AESGCM:!kSRP:!kPSK:!DSS:!RC4:!eNULL:!ADH:!AECDH:!EXPORT:!MD5:@STRENGTH',
    secureProtocol: 'SSLv23_method',
    secureOptions: constants.SSL_OP_NO_SSLv3 | constants.SSL_OP_NO_SSLv2,};

@rmp135
Copy link

rmp135 commented Mar 23, 2017

I realise this is a fairly old issue but I figured others could benefit from a solution.

You can add https support by modifying the /configs/standalone.js file.

First, import the fs module.

Then, find the plugins array and add the following to where the packagepath is "connect-architect/connect".

secure: {
  key: fs.readFileSync('/path/to/key.pem'),
  cert: fs.readFileSync('/path/to/cert.pem')
}

@nightwing
Copy link
Member

added in 2c70bda

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

No branches or pull requests

4 participants