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

Error: unable to verify the first certificate #359

Closed
karbica opened this issue May 2, 2018 · 7 comments
Closed

Error: unable to verify the first certificate #359

karbica opened this issue May 2, 2018 · 7 comments

Comments

@karbica
Copy link

karbica commented May 2, 2018

I am unable to serve up directories. I used create-react-app, ran a build, and attempted to serve it up.

Ran into this error...

(node:22821) UnhandledPromiseRejectionWarning: Error: unable to verify the first certificate
    at TLSSocket.<anonymous> (_tls_wrap.js:1105:38)
    at emitNone (events.js:106:13)
    at TLSSocket.emit (events.js:208:7)
    at TLSSocket._finishInit (_tls_wrap.js:639:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38)
(node:22821) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:22821) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Here are my versions...

{ asdf: '0.1.0',
  npm: '5.6.0',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.11.1',
  openssl: '1.0.2o',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.19.1',
  v8: '6.2.414.50',
  zlib: '1.2.11' }

I do have a cafile set in my .npmrc file. Another program, httpster, works fine.

I removed the cafile setting to no avail.

@karbica
Copy link
Author

karbica commented May 2, 2018

I have found the issue.

I'm using an private npm repository, but when setting it to https://registry.npmjs.com, it works.

Why does the npm registry matter when I'm trying to serve static files?

@karbica
Copy link
Author

karbica commented May 2, 2018

I have just reset my registry key in .npmrc to point back to my internal npm registry and it works fine.

This was weird.

@karbica
Copy link
Author

karbica commented May 11, 2018

Dropping in to note that the issue still persists. A custom registry entry in .npmrc is causing the error mentioned above in the first comment. Resetting the registry entry only gets everything working momentarily until the machine is rebooted or changes networks.

@Vajidbaba
Copy link

@karbica where is .npmrc file

@ghuser
Copy link

ghuser commented May 14, 2018

I have the same issue. I just try to do this: node_modules/.bin/serve --ignore node_modules. I use nexus3 as registry:

my ~/.npmrc is

proxy=http://myproxy:8080/
https-proxy=http://myproxy:8080/
registry=http://nexusrepo/nexus3/repository/npmjs-group/
@myscope:registry=http://nexusrepo/nexus3/repository/npmjs-my-hosted/

node -v
v8.11.1

npm -v
6.0.1

npm ls --depth=0
npmtest@1.0.0 /tmp/npmtest
├── lodash@4.17.10
└── serve@6.5.6

@karbica
Copy link
Author

karbica commented May 14, 2018

@Vajidbaba

; cli configs
metrics-registry = "https://artifacts.d.company.com/api/npm/npm-virt"
scope = ""
user-agent = "npm/5.6.0 node/v8.11.1 darwin x64"

; userconfig /Users/karbica/.npmrc
@company:registry = "https://artifacts.d.company.com/api/npm/npm-virt"
always-auth = true
cafile = "/Users/karbica/Documents/companycert.pem"
email = "karbi@company.com"
registry = "https://artifacts.d.company.com/api/npm/npm-virt"
strict-ssl = true

; node bin location = /Users/karbica/.nvm/versions/node/v8.11.1/bin/node
; cwd = /Users/karbica
; HOME = /Users/karbica

And here is this...

$ npm ls -g --depth=0
/Users/karbica/.nvm/versions/node/v8.11.1/lib
├── lerna@2.11.0
├── npm@5.6.0
└── serve@6.5.6

@leo
Copy link
Contributor

leo commented May 28, 2018

Closing this now, as this issue is not related to serve, but rather to the way how you're installing it from npm.

Thank you for the effort you've put into this!

Please also read the docs for the new release.

🙏

@leo leo closed this as completed May 28, 2018
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

4 participants