Skip to content

Commit

Permalink
fix HTTPS downloads by service on webOS 5+
Browse files Browse the repository at this point in the history
By default, Node.js uses its builtin certificate store, which is
outdated on webOS. Node.js v7.5.0 added the --use-openssl-ca command
line option, and the additional options are read from the NODE_OPTIONS
environment variable since v8.0.0. Therefore we can make node use the
OpenSSL certificate store for services run with our run-js-service on
webOS 5 (which uses v8.12.0) and newer by setting NODE_OPTIONS.
  • Loading branch information
throwaway96 committed Oct 19, 2023
1 parent 7cb5a07 commit cb17601
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/run-js-service
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

# NODE_OPTIONS is only supported by node v8.0.0 (so webOS 5+)
export NODE_OPTIONS='--use-openssl-ca'

# :^)
eval "$(sed -e '/^thirdparty_jail=/s/=.*/=off/' \
-e '\@/var/luna/preferences/devmode_enabled@s/if /&false \&\& /' \
Expand Down

0 comments on commit cb17601

Please sign in to comment.