How to get .crt and .key files from ? I just have .pem files

Hi,
I installed successfully HTTPS on my site: I got ion my folder:

cert.pem
chain.pem
fullchain.pem
privkey.pem

My nodeJS requires that to run on HTTPs:
CRT and .KEY files

var ssl = {
ca: fs.readFileSync(’/etc/apache2/ssl/AlphaSSL.crt’),
cert: fs.readFileSync(’/etc/apache2/ssl/mysite.com.crt’),
key: fs.readFileSync(’/etc/apache2/ssl/mysite.com.key’)
};

Question : Where to get .crt and .key from ?

2 Likes

According to the Node.js v5.3.0 Documentation it just accepts PEM files?

You do realize file extensions do not say everything about a file, right?

The are just different “extensions” but are all essentially text files.

your key file (mysite.com.key) will be privkey.pem
your cert file (mysite.com.crt) will be cert.pem
your ca file ( AlphaSSL.crt in your example) will be chain.pem or fullchain.pem ( depending exactly what you need )

3 Likes

No need to be condescending. In general, extensions do say stuff about files, and I wouldn't expect a Node dev to need to know the intricacies of SSL (or is it TLS?) certificates. They just want a secure connection.

I'm also a Node dev and I've been using Let's Encrypt for years and still don't know (or really care) what these files are about, and why other tools need .crt files. Node isn't the only one; every time I setup a MongoDB instance, it needs some CRT file that's two of these .PEM files concatenated; I never remember which. The nature of LE is that you use it once in a blue moon and hopefully you don't need to worry about (until autorenewal fails but that's another story). Lack of repetition makes it easy to forget things.

If the aim of Let's Encrypt is to make certificates easy to get an use, then some explanations about these extensions would help.

Anyway, thanks @serverco for clearing that up.

1 Like

@dandv

a) You realise you’re kicking a thread from almost 5 years ago?
b) Not trying to be condescending. If I tried, you’d have known it. I’m sometimes just dumbfounded by the lack of autodidacticism. I would never implement something, until I’ve got a good grasp on the subject. IMHO it would be bad practice to implement a feature and not knowing anything about it.
c) Also, it’s mainly Windows systems where extensions really have meaning. On Linux/unix systems, extensions really don’t mean as much. Out Let’s Encrypt glossary actually mentions PEM files, so that would have been a good starting point: the Let’s Encrypt documentation.