Closed junlarsen closed 3 years ago
I know I'm bumping an old issue, and I only tested this for the official client API, but this should be pretty easy to implement. It looks like ws
allows for using a custom https.Agent
("Any other option allowed in http.request() or https.request()") and so does node-fetch
. I'll open up a PR if I end up using this package.
Sounds good, let me know if you want me to assign you this issue if you end up using the library.
I think I'll use it, feel free to assign me this issue. Do you want me to commit the certificate to the repo or download it in one of the npm
scripts or..?
Great, glad to see that you're interested. As for the sourcing of the certificate I think it's best to download it through an npm script. We don't know if the URL or certificate may change and hard-coding that would become a maintainability burden and it means that programs could fail at any time.
To make the addition as backwards-compatible as possible I suggest we add a certificate field to the credentials object which is returned by authenticate and then each API will consume this field to access the certificate. We could then have authenticate() take an optional object accepting the path to the .pem file.
That sounds like a great way to handle it with respect to backwards-compatibility and maintainability. I'll have a PR ready sometime soon!
This issue can be closed now. :)
Resolved in #44 and released under 5.2.0
Right now, the node version ignores any certification rejections for any requests.
The LCU docs provide a
riotgames.pem
certificate which could be passed along with the requests and in return remove the certification rejection flag for the http requests.