Created
February 27, 2018 19:10
-
-
Save danielwpz/723d45d7f73bc1f54f4fe0ebc857493b to your computer and use it in GitHub Desktop.
Shell script for macOS to build node.js in FIPS mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NODE_VERSION="8.9.3" | |
OPEN_SSL_FIPS_VERSION="2.0.16" | |
buildOpenSSLFips() { | |
curl -L http://www.openssl.org/source/openssl-fips-$OPEN_SSL_FIPS_VERSION.tar.gz -o openssl-fips-$OPEN_SSL_FIPS_VERSION.tar.gz | |
tar -xvzf openssl-fips-$OPEN_SSL_FIPS_VERSION.tar.gz | |
pushd openssl-fips-$OPEN_SSL_FIPS_VERSION | |
chmod u+x Configure | |
./Configure darwin64-x86_64-cc | |
make | |
make install | |
popd | |
} | |
buildNodeFips() { | |
curl -L https://github.com/nodejs/node/archive/v$NODE_VERSION.zip -o $NODE_VERSION.zip | |
unzip $NODE_VERSION.zip | |
pushd "node-$NODE_VERSION" | |
./configure --openssl-fips=/usr/local/ssl/fips-2.0 | |
make -j4 | |
make install | |
popd | |
} | |
verifyNodeFips() { | |
cp node-$NODE_VERSION/out/Release/node ./ | |
echo "===== Node has openssl version =====" | |
./node -p "process.versions.openssl" | |
echo "====================================" | |
} | |
buildOpenSSLFips | |
buildNodeFips | |
verifyNodeFips |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment