Skip to content

Commit 68963f2

Browse files
committed
Update the OpenSSL binary to v3.0.7
This also adds a build command that uses Docker
1 parent fa7ada8 commit 68963f2

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
22
dist
33

4-
build/**/src
5-
build/**/*.tar.gz
4+
emscr/builds/**/src
5+
emscr/builds/**/*.tar.gz

README.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,36 @@ After each command, the files in the memory filesystem are gathered and passed t
4141

4242
## Compiling OpenSSL
4343

44-
First, [install the Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html). You can then easily recompile the OpenSSL WebAssembly binary by calling the following command. Note that this is not neccessary, as [it's already compiled](/emscr/binary).
44+
You can compile the OpenSSL WebAssembly binary by calling one the following commands. Note that this is not neccessary, as [it's already compiled](/emscr/binary).
45+
46+
Both call the script in [`emscr/builds/openssl/build.sh`](/emscr/builds/openssl/build.sh). It fetches and extracts the OpenSSL sources as a `.tar.gz` archive from https://www.openssl.org/source. It then compiles them with Emscripten by calling `emconfigure` and `emmake` (both with specific flags).
47+
48+
The created files `openssl.wasm` and `openssl.js` are then copied into `emscr/binary`, where the webpack server will deliver them from.
49+
50+
### Option 1: Using Docker
51+
52+
First, [install and start Docker](https://docs.docker.com/get-docker). Then run the following command:
4553

4654
```shell
47-
$ npm run build:openssl
55+
$ npm run build:openssl:docker
4856
```
4957

50-
This will call the script in [`emscr/builds/openssl/build.sh`](/emscr/builds/openssl/build.sh). It fetches the OpenSSL sources as a `.tar.gz` archive from https://www.openssl.org/source and extracts it. It then compiles them with Emscripten by calling `emconfigure` and `emmake` (both with specific flags).
58+
This will fetch Emscripten's Docker image [`emscripten/emsdk`](https://hub.docker.com/r/emscripten/emsdk) and run the build script.
5159

52-
The created files `openssl.wasm` and `openssl.js` are then copied into `emscr/binary`, where the webpack server will deliver them from.
60+
> This option should work cross-platform.
61+
62+
### Option 2: Manually (without Docker)
63+
64+
First, [install the Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html). Then run the following command:
65+
66+
```shell
67+
$ npm run build:openssl
68+
```
69+
70+
> This option may only work using Linux. It failed for us on macOS and we therefore recommend [Option 1: Using Docker](#option-1-using-docker).
5371
5472

55-
## Docker Integration
73+
## Running this project with Docker
5674

5775
The source code contains a [`Dockerfile`](/Dockerfile) which allows you to create ready-to-run [Docker](https://www.docker.com) images. These are comparable to snapshots in virtual machines.
5876

@@ -77,7 +95,7 @@ You should now be able to view the OpenSSL Webterm at http://localhost:4300
7795

7896
## Contributing
7997

80-
Any contributions are **greatly appreciated**. If you have a suggestion that would make this better, please open an issue or fork the repository and create a pull request.
98+
Any contributions are greatly appreciated. If you have a suggestion that would make this better, please open an issue or fork the repository and create a pull request.
8199

82100
## License
83101

emscr/binary/openssl.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

emscr/binary/openssl.wasm

17.7 KB
Binary file not shown.

emscr/builds/openssl/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
OPENSSL_VERSION="openssl-3.0.1"
3+
OPENSSL_VERSION="openssl-3.0.7"
44
OPENSSL_DIR="src"
55

66
if [ -d ${OPENSSL_DIR} ]; then

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"serve": "webpack serve --mode development",
77
"build": "rm -rf dist && webpack --mode production && rm -f dist/*.LICENSE.txt",
8-
"build:openssl": "cd emscr/builds/openssl && ./build.sh ${ARG}"
8+
"build:openssl": "cd emscr/builds/openssl && ./build.sh ${ARG}",
9+
"build:openssl:docker": "docker run --rm -v $(pwd):$(pwd) -w $(pwd)/emscr/builds/openssl -u $(id -u):$(id -g) --platform linux/amd64 emscripten/emsdk /bin/bash ./build.sh ${ARG}"
910
},
1011
"keywords": [
1112
"openssl",

0 commit comments

Comments
 (0)