Go WASM interop supports x509, PEM and other cryptography functions
(but not all), so there is no reason not to include those in
the wasm build.
This will also fix compilation errors for when something is
using webrtc and targets both wasm and server
The PR was tested locally (via a simple web folder with wasm_exec.js
and index.html) and I confirmed being able to generate a X509
certificate
Update CertificateFromPEM to be a loop over the PEM blocks.
This allows decoding the private key before decoding the certificate.
Tries to parse the certificate block directly but if that errors,
then it also tries to base64 decode the certificate block.
Fixes#3042
When attempting to interact with a WebRTC service a user was getting a
DTLS alert of UnknownCA. The remote service was asserting the lifetime +
subject of the certificate. This PR modifies Pion's certificate
generation code to match libwebrtc so it can work with the WebRTC
service.
Resolves#1940
Instead of printing the error to stdout return the error to the user.
This may not be a hard error (as later certificates would have passed)
but it never is good to be in a state where you have certificates in a
broken state.
Resolves#586
Fixes#515
This includes a few small and closely related changes:
1. All occurrences of the build tag `+build js` have been changed to the
more precise `+build js,wasm`. This will exclude the files from being
included by third-party compilers like GopherJS, with which they are
incompatible.
2. Some files which are incompatible with JavaScript/Wasm now have the
correct build tag (`+build -js`) so they will be excluded from Wasm
builds.
3. Some configuration options which are incompatible with
JavaScript/Wasm (or at least the current bindings) will now no longer
appear in Wasm builds. This meant creating new files with new struct
definitions and the appropriate build tags.