How to use the tls function from node-forge
Find comprehensive JavaScript node-forge.tls code examples handpicked from public code repositorys.
350 351 352 353 354 355 356 357 358 359
__Examples__ ```js // create TLS client var client = forge.tls.createConnection({ server: false, caStore: /* Array of PEM-formatted certs or a CA store object */, sessionCache: {}, // supported cipher suites in order of preference
5
35
6
327 328 329 330 331 332 333 334 335 336
caStore: /* Array of PEM-formatted certs or a CA store object */, sessionCache: {}, // supported cipher suites in order of preference cipherSuites: [ forge.tls.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA, forge.tls.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA], virtualHost: 'example.com', verify: function(connection, verified, depth, certs) { if(depth === 0) { var cn = certs[0].subject.getField('CN').value;
1
8
2
+ 5 other calls in file
GitHub: matth-c3/forge
244 245 246 247 248 249 250 251 252 253
verify: function(connection, verified, depth, certs) { if(depth === 0) { var cn = certs[0].subject.getField('CN').value; if(cn !== 'example.com') { verified = { alert: forge.tls.Alert.Description.bad_certificate, message: 'Certificate common name does not match hostname.' }; } }
767
0
0
+ 17 other calls in file
node-forge.pki is the most popular function in node-forge (10287 examples)