pwa-builder / PWABuilder-CLI

Node.js tool for App Generation
Other
1.63k stars 142 forks source link

Websites with invalid SSL certificates #180

Closed mattwoberts closed 7 years ago

mattwoberts commented 8 years ago

If you attempt to run the generated ios code against a URL that has an invalid SSL certitificate, then it doesn't work, and the URL is not served up.

The suggested workaround as per http://stackoverflow.com/a/15467440 (changing the code in AppDelegate.m) doesn't make a difference either.

Is there a workaround for this - in development it's quite likely that you'd have an invalid SSL certificate.

boyofgreen commented 8 years ago

Hi Matt, We'll look into this, is this in generating the app or running the app you get an error? If generating, you should be able to work around with a local version of the manifest (use the -m with a path the manifest), so it doesn't trip up on the manifest retrieval.

mattwoberts commented 8 years ago

Hi,

It's when you run the app - you can generate OK (I think, although I may have generated against a site with a valid SSL and then changed the URL after). It's only an issue on IOS

lucyllewy commented 8 years ago

I'm getting an error with generating the app when using a self-signed certificate:

ERROR: Failed to retrieve manifest from site.

Adding a console.log(err) on line 72 of manifestTools.js reports that it doesn't like the certificate (understandable, but there should be the option of accepting invalid certs):

{ [Error: unable to verify the first certificate]
  message: 'unable to verify the first certificate',
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' }
SteveSandersonMS commented 5 years ago

Since it's based on Node, you can make it accept self-signed certs by running the following before pwabuilder:

set NODE_TLS_REJECT_UNAUTHORIZED=0

(or equivalent for non-Windows OS)