Skip to content

support native tls for some configurations (proxies, custom roots, self-signed certificates etc.) #30

@markmehere

Description

@markmehere

🐛 Bug description

Using WASM Rust from behind a corporate firewall with self-signed certificates does not work. binary-install chokes on the self-signed certificate.

The solution to the problem is spelled out here:

When you use native-tls, ureq will use your OS' certificate verifier and root store.

Cargo works without issue and nothing has been done on our side to support this.

🤔 Expected Behavior

Hoping to be able to use WASM Rust from my corporate PC without issue - just like I can use cargo.

Setting environment variables to achieve this is pretty standard for people in my position, so the following would be fine:

export USE_NATIVE_TLS=1 && wasm-pack build

👟 Steps to reproduce

  1. In an environment with a self-signed certificate without WebAssembly run wasm-pack build
  2. Observe the defect:
[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
    Finished `release` profile [optimized] target(s) in 0.04s
Error: failed to download from https://github.com/WebAssembly/binaryen/releases/download/version_117/binaryen-version_xxx_xxx.tar.gz
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.
Caused by: failed to download from https://github.com/WebAssembly/binaryen/releases/download/version_117/binaryen-version_117-xxx-xxx.tar.gz
To disable `wasm-opt`, add `wasm-opt = false` to your package metadata in your `Cargo.toml`.

🌍 Your environment

  • Self-signed certificate only trusted by my corporation's custom root
  • This software that I would definitely not recommend

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions