hbz / lobid-gnd

UI and API to the Integrated Authority File (Gemeinsame Normdatei, GND)
http://lobid.org/gnd
Eclipse Public License 2.0
25 stars 5 forks source link

`UNABLE_TO_VERIFY_LEAF_SIGNATURE` when trying to access Lobid API via Node.js #342

Closed stefandesu closed 1 year ago

stefandesu commented 1 year ago

When trying to access Lobid API via Node.js (in my case through axios, but also reproducible with fetch), it throws an UNABLE_TO_VERIFY_LEAF_SIGNATURE error. As far as I understand from my research, this is a server configuration error where "the server is, incorrectly, not returning the intermediate certificates" (see https://github.com/nodejs/node/issues/33705#issuecomment-637934459). This is not an issue when the API is used in the browser as browser vendors include the relevant SSL Root CAs.

Easy example (requires Node.js 18 as it has native fetch):

fetch("https://lobid.org/gnd/4074335-4.json")
  .then((response) => {
    console.log(response)
  })
  .catch((error) => {
    console.error(error)
  })
dr0i commented 1 year ago

Thx @stefandesu for the issue: we had a new chain.txt for SSL certificates for an other domain, but didn't merge that chain.txt with the old one. Merged it now so it should work again. Sorry for that.

stefandesu commented 1 year ago

Thanks, it works again! 👍