totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

set ssl and work with https #610

Closed mahdi-gh33 closed 6 years ago

mahdi-gh33 commented 6 years ago

Hi Peter I want to work with https and I set my index.js like this :

var fs = require('fs');

var options = {};
options.https = {
   pfx: fs.readFileSync('./SSL/TolueAryan.pfx'),
   passphrase: 'mypass'
};
options.port = 8000;

require('total.js').https('release', options);

the server is coming up but it does't work!!!what should I do now?

petersirka commented 6 years ago

Can you write more info? What does the console read?

mahdi-gh33 commented 6 years ago

the console is show this but I can't access to that when I use : https://0.0.0.0:8000/

C:\toluebot\totaljs>node index
====================================================
PID         : 1500
Node.js     : v9.4.0
Total.js    : v2.9.2
OS          : win32 6.3.9600
====================================================
Name        : Total.js
Version     : 1.0.0
Author      : You company name
Date        : 2018-02-10 13:24:48
Mode        : release
====================================================

https://0.0.0.0:8000/

I need a simple https server .

petersirka commented 6 years ago

Ok and what's happend when you open https://127.0.0.1:8000?

mahdi-gh33 commented 6 years ago

When I openhttps://localhost:8000/ I see that my site isn't secure .

petersirka commented 6 years ago

isn't secure: :-) of course because the browser doesn't accept your certificate as trusted. Do you have SSL from some trusted authority? I think that localhost won't work as trusted ....

webdesus commented 6 years ago

@mahdi-gh1373 if you project not working with money, i would be recommend this service. It's free ssl witch working fine in all browsers. For financial projects I would be recommend use paid services

lodwig commented 5 years ago

Hi, Peter.

I got same problem here my certificate is trusted it's show when i'am open in browser but when i'am open in PostMan Application with get on same address it's failed.

I am trying to get using cURL on my terminal no issue found. I am using OSX but on cURL with other client using ubuntu it's show error :

curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html

nb: i was trying to run with : node --tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256" debug.js still same.