rustwasm / book

The Rust and WebAssembly Book
https://rustwasm.github.io/docs/book/
MIT License
1.75k stars 211 forks source link

Is there any way to run Rust/wasm with HTTPS? #145

Closed anderspitman closed 5 years ago

anderspitman commented 5 years ago

When modifying the webpack-dev-server config to add https, I'm getting the following error:

Error importing `index.js`: DOMException: "The operation is insecure.".

Apparently it has something to do with the way the async import works. Is there a way around this?

anderspitman commented 5 years ago

I have no idea what I did but somewhere along the way it started working.

anderspitman commented 5 years ago

Ok so it was working with my self-signed local certificate, but now I'm getting the same error as before when hosted publicly with my Let's Encrypt cert. Any ideas?

alexcrichton commented 5 years ago

FWIW the setup for HTTPS/wasm isn't too special, everything's just typically served over HTTPS! For example all wasm-bindgen examples are served over HTTPS, and they're not configured specially one way or another.

Does the exception in the console have a stack trace? Could that be pinpointed as to which JS operation is happening to caues the exception?

anderspitman commented 5 years ago

Thanks @alexcrichton.

Chrome gave more details. I'm opening a websocket connection which was using ws:// and needed to be changed to wss://.