mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-12 22:10:01 -04:00
include certs in compiled output
This commit is contained in:
parent
961ce1c37f
commit
663f31cd6e
4 changed files with 71 additions and 12 deletions
18
client/tools/generate_cert.sh
Executable file
18
client/tools/generate_cert.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
#export ca certs to a c header file
|
||||
|
||||
set -e
|
||||
|
||||
CURL_PREFIX=$(realpath build/curl-wasm)
|
||||
CACERT_FILE="$(realpath build/cacert.pem)"
|
||||
CACERT_HEADER="$CURL_PREFIX/include/cacert.h"
|
||||
|
||||
CACERT_DIR="$(dirname $CACERT_FILE)"
|
||||
REPLACE_STR="$(echo $CACERT_DIR | tr '/-' '_')"
|
||||
|
||||
if [ ! -f $CACERT_FILE ]; then
|
||||
wget "https://curl.se/ca/cacert.pem" -O $CACERT_FILE
|
||||
fi
|
||||
xxd -i $CACERT_FILE > $CACERT_HEADER
|
||||
sed -i "s/$REPLACE_STR//" $CACERT_HEADER
|
Loading…
Add table
Add a link
Reference in a new issue