Skip to content

Commit

Permalink
feat(proxy): replace selfsigned by openssl
Browse files Browse the repository at this point in the history
This module appears to be no longer maintained and is not compatible with Node 12.

See jfromaniello/selfsigned#33
  • Loading branch information
julien-f committed Apr 15, 2020
1 parent 7cf8e5a commit 9197844
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
1 change: 0 additions & 1 deletion @xen-orchestra/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"parse-pairs": "^1.0.0",
"promise-toolbox": "^0.15.0",
"pump": "^3.0.0",
"selfsigned": "^1.10.7",
"source-map-support": "^0.5.16",
"stoppable": "^1.0.6",
"xdg-basedir": "^4.0.0",
Expand Down
25 changes: 25 additions & 0 deletions @xen-orchestra/proxy/src/_genSelfSignedCert.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { execFile } from 'child_process'

const openssl = (cmd, args, { input, ...opts } = {}) =>
new Promise((resolve, reject) => {
const child = execFile('openssl', [cmd, ...args], opts, (error, stdout) =>
error != null ? reject(error) : resolve(stdout)
)
if (input !== undefined) {
child.stdin.end(input)
}
})

export async function genSelfSignedCert() {
const key = await openssl('genrsa', ['2048'])
return {
cert: await openssl(
'req',
['-batch', '-new', '-key', '-', '-x509', '-days', '360', '-nodes'],
{
input: key,
}
),
key,
}
}
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11629,11 +11629,6 @@ node-fetch@^1.0.1:
encoding "^0.1.11"
is-stream "^1.0.1"

[email protected]:
version "0.9.0"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.9.0.tgz#d624050edbb44874adca12bb9a52ec63cb782579"
integrity sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==

node-forge@^0.7.0:
version "0.7.6"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.6.tgz#fdf3b418aee1f94f0ef642cd63486c77ca9724ac"
Expand Down Expand Up @@ -14361,13 +14356,6 @@ scss-tokenizer@^0.2.3:
js-base64 "^2.1.8"
source-map "^0.4.2"

selfsigned@^1.10.7:
version "1.10.7"
resolved "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.7.tgz#da5819fd049d5574f28e88a9bcc6dbc6e6f3906b"
integrity sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==
dependencies:
node-forge "0.9.0"

semver-compare@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
Expand Down

0 comments on commit 9197844

Please sign in to comment.