Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5: Enable mbedTLS module for Crypto object, force disable Asset Library #61402

Merged
merged 2 commits into from
May 25, 2022

Conversation

akien-mga
Copy link
Member

Increases the size of the wasm by around 3% (~300-350 KiB).

This enables using the Crypto object for hashing, signing and encryption,
and therefore reduces the gap between the features of the HTML5 platform
and other platforms.

Closes godotengine/godot-proposals#3574.

@akien-mga akien-mga added enhancement platform:web topic:porting cherrypick:3.x Considered for cherry-picking into a future 3.x release labels May 25, 2022
@akien-mga akien-mga added this to the 4.0 milestone May 25, 2022
@akien-mga akien-mga requested a review from a team as a code owner May 25, 2022 10:06
@akien-mga akien-mga force-pushed the html5-enable-mbedtls branch from ee6b01e to bbc2c3f Compare May 25, 2022 10:37
@akien-mga akien-mga requested a review from a team as a code owner May 25, 2022 10:37
@akien-mga
Copy link
Member Author

Also removed the matching notes from the documentation. Didn't test that the features actually work fine yet though.

There's also still a similar note in WebSocketServer but I think this one is due to browser limitations and not mbedTLS? @Faless

@akien-mga
Copy link
Member Author

akien-mga commented May 25, 2022

The Asset Library might need more work to be usable in the Web build, with this PR it's now enabled but spams warnings:

WARNING: HTTPClient polled multiple times in one frame, but request cannot progress more than once per frame on the HTML5 platform. [godot.tools.js:369:18](http://localhost:3000/godot.tools.js)
   at: poll (platform/javascript/http_client_javascript.cpp:270) - HTTPClient polled multiple times in one frame, but request cannot progress more than once per frame on the HTML5 platform. [godot.tools.js:369:18](http://localhost:3000/godot.tools.js)

And it doesn't show any asset.

There are also those two warnings when the asset lib plugin is set up:

WARNING: HTTP proxy feature is not available [godot.tools.js:369:18](http://localhost:3000/godot.tools.js)
   at: set_http_proxy (core/io/http_client.cpp:847) - HTTP proxy feature is not available [godot.tools.js:369:18](http://localhost:3000/godot.tools.js)
WARNING: HTTPS proxy feature is not available [godot.tools.js:369:18](http://localhost:3000/godot.tools.js)
   at: set_https_proxy (core/io/http_client.cpp:861) - HTTPS proxy feature is not available

@Faless
Copy link
Collaborator

Faless commented May 25, 2022

As mentioned in chat, the asset library cannot work right now because browsers requires CORS which github (where the assets are hosted) do not allow.

To support the asset library in the browsers we would need to either host or mirror the assets somewhere else, allowing CORS (at least from our domain).

@Faless
Copy link
Collaborator

Faless commented May 25, 2022

There's also still a similar note in WebSocketServer but I think this one is due to browser limitations and not mbedTLS?

Yeah, browsers only have the client API, so there is no way to implement a WebSocketServer there.

akien-mga added 2 commits May 25, 2022 14:19
GitHub doesn't allow CORS so we can't download assets from it.

There'd also be more work needed for the Asset Library plugin to be
usable in the Web editor even if that was supported.
Increases the size of the wasm by around 3% (~300-350 KiB).

This enables using the Crypto object for hashing, signing and encryption,
and therefore reduces the gap between the features of the HTML5 platform
and other platforms.

Closes godotengine/godot-proposals#3574.
@akien-mga akien-mga force-pushed the html5-enable-mbedtls branch from bbc2c3f to 3ff6d79 Compare May 25, 2022 12:20
@akien-mga akien-mga changed the title HTML5: Enable mbedTLS module for Crypto object HTML5: Enable mbedTLS module for Crypto object, force disable Asset Library May 25, 2022
@akien-mga
Copy link
Member Author

akien-mga commented May 25, 2022

I added a commit to always disable the Asset Library on HTML5 without relying on the availability of StreamPeerSSL only.

@akien-mga akien-mga merged commit 5f8888c into godotengine:master May 25, 2022
@akien-mga akien-mga deleted the html5-enable-mbedtls branch May 25, 2022 12:51
@akien-mga
Copy link
Member Author

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label May 25, 2022
akien-mga added a commit to akien-mga/godot that referenced this pull request Jun 29, 2022
Follow-up to godotengine#61402.
Will need a cleanup as it's getting a bit messy.

Fixes godotengine#62520.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable mbedTLS Crypto object in official HTML5 builds
2 participants