I am trying to get product list in response from catalog api .so for that
i am trying to get all sku`s from that api in an array.
I have download Service example app from github.
done some changes in manifest.json
“name”: “Error”,
“message”: “Client network socket disconnected before secure TLS connection was established”,
“stack”: “Error: Client network socket disconnected before secure TLS connection was established\n at connResetException (node:internal/errors:691:14)\n at TLSSocket.onConnectEnd (node:_tls_wrap:1585:19)\n at TLSSocket.emit (node:events:538:35)\n at endReadableNT (node:internal/streams/readable:1345:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”
Generally the VTEX kuberouter will block outgoing HTTPS requests, although linked apps may be an exception to this rule for some reason.
The solution usually is the VTEX route without https, for example: https://${context.account}.vtexcommercest....
Use http instead https and then set an X-VTEX-Use-Https: true on header.
This will allow the request to get through the router, and it will be changed to HTTPS once it leaves our infrastructure
To apply it, simply run git apply community_question_26744.patch from within the service-example folder.
In this specific example, it looks like @Ashif112 was trying to call our Catalog API. That is usually simpler if you follow the guidance in the following documentation:
Specifically, you could be using our IO client for Catalog API, which makes it a lot easier to call the endpoints you want to use.
Now if you really had to get your code to work:
You should change the URL from https to http (as suggested by @paulobordignon)
The authentication header name should be VtexIdClientAutCookie
The List All SKU IDs endpoint should include the required page and pagesize attributes
Going through these steps allowed me to successfully list SKU IDs in my test store: