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

does this work for local LAN device accesses? #44

Closed
YunHsiao opened this issue Apr 14, 2020 · 3 comments
Closed

does this work for local LAN device accesses? #44

YunHsiao opened this issue Apr 14, 2020 · 3 comments

Comments

@YunHsiao
Copy link

YunHsiao commented Apr 14, 2020

Sorry if this is not the right place to ask this, but I'm kind of confused if this server works on LAN environment, say visiting the desktop server on the mobile device connected to the same wifi network. I kept getting error messages like this one discussed here. (all the openssl commands behaves exactly like what's described)
Seems to be certification problems, but I'm really not familiar with these, so a little help would be much appreciated.

Oh and btw, when generating the certificates, looks like there's some logging issue too:

PS D:\workspace\example-3d\show-cases\build> serve .
Serving static path: .
Generating certificates...
Certificates path: C:\Users\YunHsiao\AppData\Roaming\https-localhost. Never modify nor share this files.
Running mkcert to generate certificates...
http to https redirection active.
Certificates generated, installed and trusted. Ready to go!
Server running on port 443.
{ [Error: ENOENT: no such file or directory, open 'D:\workspace\example-3d\show-cases\build\"C:\Users\YunHsiao\AppData\Roaming\https-localhost\mkcert.log"']
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path:
   'D:\\workspace\\example-3d\\show-cases\\build\\"C:\\Users\\YunHsiao\\AppData\\Roaming\\https-localhost\\mkcert.log"' }
{ [Error: ENOENT: no such file or directory, open 'D:\workspace\example-3d\show-cases\build\"C:\Users\YunHsiao\AppData\Roaming\https-localhost\mkcert.err"']
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path:
   'D:\\workspace\\example-3d\\show-cases\\build\\"C:\\Users\\YunHsiao\\AppData\\Roaming\\https-localhost\\mkcert.err"' }
@daquinoaldo
Copy link
Owner

Hi @YunHsiao
the certificate is valid only on the device you are running the server, that is localhost.
Of course the server is accessible also from outside your PC, e.g. from you Android phone on LAN, but the phone has not the certificate and won't recognize the connection as trusted. The trick is that, at first start, a self signed certificate is issued, and then is trusted on the PC, so that on localhost it is recognised as safe. Other devices see the certificate as a self signed, that can be unsafe.

The logs are interesting. This is not related to your problem with the certificate, but there can be another problem too.
I never tried to serve a path on a different disk on Windows.
Next weekend I'll try to reproduce and I'll let you know.
Thank you for reporting.

@YunHsiao
Copy link
Author

oh I see... Looks I have to use a dedicated server to do this, thank you for the clarification.

@daquinoaldo
Copy link
Owner

Yes, if you need a certificate trusted by all the devices, you'll need a real certificate issued by a third party, this is a development certificate only.

Take a look to Let's Encrypt, they issue valid certificates for free. You will need to run your server on a public IP address on the Internet, and you'll need a domain that points to this address. Probably a dedicated server is the easier choice.

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

No branches or pull requests

2 participants