FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
https-pem/install.js at main · metcoder95/https-pem · GitHub
metcoder95
https-pem
Repository navigation
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
https-pem
/
install.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (13 loc) · 554 Bytes
Breadcrumbs
https-pem
/
install.js
Copy path
File metadata and controls
16 lines (13 loc) · 554 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict'
const
fs
=
require
(
'node:fs'
)
const
path
=
require
(
'node:path'
)
const
{
generateSync
}
=
require
(
'./generate'
)
const
nodeVersion
=
Number
(
process
.
versions
.
node
.
split
(
'.'
)
[
0
]
)
const
pems
=
// Due to new version of openssl, we need to use a larger key size
// for node 24 and above, otherwise the default key size is sufficient
nodeVersion
>
22
?
generateSync
(
{
}
,
{
keySize
:
2048
}
)
:
generateSync
(
)
fs
.
writeFileSync
(
path
.
join
(
__dirname
,
'key.pem'
)
,
pems
.
private
)
fs
.
writeFileSync
(
path
.
join
(
__dirname
,
'cert.pem'
)
,
pems
.
cert
)
Back
|
FazBrowse Home
|
New Git URL