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

Building API Plaform behind corporate proxy and injected certificate #2659

Open
adurand-ctie opened this issue Mar 6, 2024 · 0 comments
Open

Comments

@adurand-ctie
Copy link

API Platform version(s) affected: 3.2.16

Description
Error when executing corepack prepare --activate pnpm@latest:

Internal Error: Error when performing the request to https://registry.npmjs.org/pnpm; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:42195:14)
    at ClientRequest.emit (node:events:518:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:518:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
The command '/bin/sh -c corepack prepare --activate pnpm@latest' returned a non-zero code: 1
ERROR: Service 'pwa' failed to build : Build failed

How to reproduce
docker-compose build --no-cache pwa behind corporate proxy and network appliance intercepting traffic.

Possible Solution
N/A

Additional Context
Since we are behind a corporate proxy, I added the following in the Dockerfile of pwa:

RUN set HTTP_PROXY=http://proxy.etat.lu:8080
RUN set HTTPS_PROXY=http://proxy.etat.lu:8080
RUN set ALL_PROXY=http://proxy.etat.lu:8080

For the "traffic interceptor" that watches the whole traffic, I added its certificate (already injected in the image):
RUN set NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/etat.crt
I even tried to disable TLS validation:
RUN set NODE_TLS_REJECT_UNAUTHORIZED=0

Any help on this issue would be highly appreciated :)
Thanks !

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

1 participant