mwoffliner
mwoffliner copied to clipboard
Need to disable certificate checking within Docker container
I am using the docker command to run mwoffliner on my local medaiwiki server and i get the UNABLE_TO_GET_ISSUER_CERT_LOCALLY .
This is the comamnd
$ sudo docker run --volume=$(pwd)/out:/out -ti ghcr. io/openzim/mwoffliner mwoffliner --mwUrl=http://
[error] [2024-03-02T12:49:43.043Z] FATAL - Failed to get MediaWiki Metadata
[error] [2024-03-02T12:49:43.046Z] Failed to run mwoffliner after [40s]: {
"message": "unable to get local issuer certificate",
"name": "Error",
"stack": "Error: unable to get local issuer certificate\n at AxiosError.from (file:///tmp/mwoffliner/node_modules/axios/lib/core/AxiosError.js:89:14)\n at RedirectableRequest.handleRequestError (file:///tmp/mwoffliner/node_modules/axios/lib/adapters/http.js:577:25)\n at RedirectableRequest.emit (node:events:539:35)\n at RedirectableRequest.emit (node:domain:475:12)\n at eventHandlers.
},
"code": "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
"status": null
} [error] [2024-03-02T12:49:43.049Z]
unable to get local issuer certificate
So basically this ticket is about introducing an --insecure option. LGTM.
@nish2482 What is the online Mediawiki instance you test against?
Hello @kelson42, the -e NODE_TLS_REJECT_UNAUTHORIZED=0 tag can also be used to disable certificate checking right?
So do I just add this tag to the docker run commands in the README to fix this issue?
I prefer a fix independant from the container.
So basically this ticket is about introducing an
--insecureoption. LGTM.@nish2482 What is the online Mediawiki instance you test against?
It is a local media wiki installation
I prefer a fix independant from the container.
@kelson42 Okay so this is what I was thinking of after reading the code. Let me know if i'm going in the right direction.
- First I have to handle the
--insecureargument in thesrc/cli.tsandsrc/sanitize-argument.tsfiles. - And if the insecure argument is provided, set the
NODE_TLS_REJECT_UNAUTHORIZEDenvironment variable to"0", which will disable TLS/SSL certificate verification globally in Node.js. - OR an option can be added where Axios is making https requests to disable certificate verification. This would involve modifying the axios request configuration to set
httpsAgentwithrejectUnauthorizedset tofalsewhen the insecure argument is provided.
i dont see this option available when i run docker run --volume=$(pwd)/out:/out -ti ghcr.io/openzim/mwoffliner mwoffliner --help
@nish2482 Probably because you don't use the "dev" version
@nish2482 Probably because you don't use the "dev" version
sorry didnt understand