Nodejs client certificate settings.

Source: Internet
Author: User
Tags ssl connection


Recent systems require a higher level of security

Https+usbkey Certificate

The operation of HTTPS is simple

OpenSSL generates CAs and certificates, and configuration starts

After the build succeeds, it looks like this.

Like this

var options =+ '/server.key '), Cert:fs.readFileSync (__dirname+ '/server.pem '), CA: Fs.readfilesync (__dirname+ '/ca.crt '), auth:"1CUI"};
function () {        console.log (' Express server listening on port ' + server.address (). Port);    });     function (callback) {        server.close (callback);    }

But verify the client certificate, the Internet cannot find out the ready

No way, check the official documentation.

Https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener

Https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener

Additional parameters were found to configure the client certificate

Requestcert:true//Request client Certificate

Rejectunauthorized:true//Deny client connections if there is no request to the client from a trusted CA-issued certificate

Add a re-Web service. I can't connect decisively.

Chrome Error

SSL Connection Error

Err_ssl_protocol_errorHide DetailsUnable to establish a secure connection to the server. There may be a problem with the server, or you may not have a client authentication certificate that your server requires. but this means that the purpose is reached, and then, just install the client certificate. After the client certificate has been added, the final step is to "migrate" the certificate to Usbkey within the validationnot finished, encountered other problems

Nodejs client certificate settings.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.