Skip to content

Commit 1d3268f

Browse files
Miel Vander SandeRubenVerborgh
authored andcommitted
Added client certificate request
1 parent ad810c1 commit 1d3268f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/LinkedDataFragmentsServer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ function LinkedDataFragmentsServer(options) {
1515
server = require('http').createServer();
1616
break;
1717
case 'https':
18-
var httpsOptions = _.mapValues((options.ssl || {}).keys || {}, readHttpsOption);
19-
server = require('https').createServer(httpsOptions);
18+
var ssl = options.ssl || {};
19+
// WebID authentication requires a client certificate
20+
if (ssl.webid)
21+
ssl.requestCert = ssl.rejectUnauthorized = true;
22+
server = require('https').createServer(_.mapValues(ssl.keys, readHttpsOption));
2023
break;
2124
default:
2225
throw new Error('The configured protocol ' + options.protocol + ' is invalid.');

0 commit comments

Comments
 (0)