Skip to content

Set max SSL fragment size in Express #3082

@houluy

Description

@houluy

I'm using express to set up an HTTPS server for some embedded devices. However, due to the lack of computing capabilities, the default SSL fragment size 16384 is too large for these devices. I wonder how I can change this size in express.
I found that in tls modules, TLSSocket class has a method tlsSocket.setMaxSendFragment(size) which may work, but I can't find out how to use it in Express.
This is how my server is established:

var app = require('express')();
var cert_path = '/home/houlu/Programs/Node/http/ssl/';
var privateKey = fs.readFileSync(cert_path+'server.key', 'utf8');
var certificate = fs.readFileSync(cert_path+'server.crt', 'utf8');
var credentials = {key: privateKey, cert: certificate};

httpsServer = https.createServer(credentials, app);

Thanks a lot! :-)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions