Dexus / Dexus/pem

Add `start date` option to createCertificate()

Open
#30 11 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
573
Forks
126
PR merge metrics
No merged PRs in 30d

Description

When I type a URL in the browser and press Enter, the browser will try to connect to that host:port, and **wait for a moment**(several seconds); If there isn't a server at the beginning of "the moment", but a server manage to respond before the end of the timeout, the browser will accept it.

Since I have CA key/cert in my PC, I wrote a piece of code that will generate a certificate (according to its IP address), and use the certificate to start an HTTPS server. As in the case above, the request from the browser arrives before I generate the server certificate(and start the HTTPS server), but I can still respond to the request if the server can work in a very short time.

The browser will have a timestamp A when the request is sent, and the server will have a timestamp B when the certificate is signed(valid from). The problem is that, sometimes A is earlier than B, so browser will get a certificate error, given the info that the certificate has not taken into affect when you visit the website.

I think it may be a bug for the browser(Chrome), but it will be good if `pem` module can cover this by providing option `startdate`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.