expo init <project> throwing unable to verify the first certificate - expo

I'm using a work machine which is behind a corporate proxy. When I run expo init I get the below error
request to https://registry.npmjs.org/expo-template-blank failed, reason: unable to verify the first certificate
FetchError: request to https://registry.npmjs.org/expo-template-blank failed, reason: unable to verify the first certificate
at ClientRequest.<anonymous> (/Users/<username>/node_modules/minipass-fetch/lib/index.js:97:14)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:467:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:100:8)
at emitErrorCloseNT (internal/streams/destroy.js:68:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
I tried npm config set ssl-strict=false but no luck. If i'm missing the certs, then where do I add those? All solutions I see is asking to add some sort of code in the file. But in my case I haven't created a file yet. How do I fix this issue?

I just disabled the proxy and it worked.

Related

SSL certificate verification failed when trying to build GraalVM compiler with mx

I'm trying to build the GraalVM compiler using the mx build tool. I've Python 3.10.4 and Java 17.0.2 in my PATH. However, when I run mx I get the following message:
Downloading COMMONS_MATH3_3_2 from ['https://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.2/commons-math3-3.2.jar', 'https://search.maven.org/remotecontent?filepath=org/apache/commons/commons-math3/3.2/commons-math3-3.2.jar']
Error downloading from https://repo1.maven.org/maven2/jline/jline/2.14.6/jline-2.14.6.jar to /Users/cesarsv/.mx/cache/JLINE_c3aeac59c022bdc497c8c48ed86fa50450e4896a/jline.jar: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
WARNING: ** If behind a firewall without direct internet access, use the http_proxy environment variable (e.g. "env http_proxy=proxy.company.com:80 mx ...") or download manually with a web browser.
Error downloading from https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.12.2/scala-reflect-2.12.2.jar to /Users/cesarsv/.mx/cache/SCALA_REFLECT_12_fa13c13351566738ff156ef8a56b869868f4b77e/scala-reflect-12.jar: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
...
The error seems to be related to an SSL certificate validation when downloading the dependencies necessary for the GraalVM build with mx. There is no clear solution for this issue in the GitHub repo of the used tools.
It seems that mx uses python to fetch the artifacts that it needs for the build from external repositories. Python 3.7 and above don't have any SSL certificates activated by default. Therefore, the scripts used by mx can't validate any SSL connections.
So I activate SSL in Python manually by creating and running the file install_certificates.command and it solved my problem.

Is there any way to fix hardhat Unable signature

Any time I try to deploy the contract I get this error
image; https://ibb.co/SfzQ1MW
gitpod /workspace/luck $ npx hardhat run scripts/deploy.js --network testnet
Downloading compiler 0.8.4
Compiling 16 files with 0.8.4
Compilation finished successfully
FetchError: request to https://moeing.tech:9545/ failed, reason: unable to verify the first certificate
at ClientRequest.<anonymous> (/workspace/luck/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (node:events:390:28)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
type: 'system',
errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
I will really appreciate your help
The issue is not specifically from hardhat but an issue faced by node-fetch which hardhat uses in the background to send the request. The main cause of this is a problem with your certificates as discussed in this question Unable to verify leaf signature.
What worked for me was to use a VPN, I assume there was an issue with my router. Once I was connected to the VPN I managed to deploy the contract successfully.

gcloud init ERROR: gcloud crashed (ConnectionError)

Google Cloud SDK installer is downloaded successfully.
After successful installation, it runs gcloud init command
It asked for sign-in
After providing signing in details, the following error occurs
ERROR: gcloud crashed (ConnectionError):
HTTPSConnectionPool(host='oauth2.googleapis.com', port=443):
Max retries exceeded with url: /token (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000016A45426A08>:
Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
How to handle this error?
I was trying gcloud init on a remote desktop, and received this error: gcloud crashed (ConnectionError)
The following solution worked for me.
I used the command gcloud init --console-only instead of gcloud init
SSL verification fails mostly if you are behind proxy. You can disable ssl auth for gcloud client using below cmd:
gcloud config set auth/disable_ssl_validation True
Google will eventually block your IP when you exceed a certain amount of requests.
You can try to create another superuser form command line may be it will resolve the issue.
When i was trying with broadband it was giving same error, but when i switched to mobile data, everything is working fine for me.

Error: self signed certificate in certificate chain for the tests in the Next.js page tests with next-page-tester

I'm looking for a way to overcome the Error: self signed certificate in certificate chain for the tests when I try to set up Next.js page tests with next-page-tester.
Network Error
at createError (node_modules/axios/lib/core/createError.js:16:15)
at XMLHttpRequest.handleError (node_modules/axios/lib/adapters/xhr.js:84:14)
at XMLHttpRequest.invokeTheCallbackFunction (node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js:18:28)
at XMLHttpRequest.<anonymous> (node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:35:32)
at innerInvokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:338:25)
at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
at XMLHttpRequestImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9)
at fireAnEvent (node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36)
at requestErrorSteps (node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:130:3)
at Object.dispatchError (node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:59:3)
at Request.<anonymous> (node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:655:18)
at Request.onRequestError (node_modules/request/request.js:877:8)
console.error
Error: Error: self signed certificate in certificate chain
at Object.dispatchError (C:\Users\leoniecg\Projects\OneCustomerFrontend\frontend\node_modules\jsdom\lib\jsdom\living\xhr\xhr-utils.js:62:19)
at Request.<anonymous> (C:\Users\leoniecg\Projects\OneCustomerFrontend\frontend\node_modules\jsdom\lib\jsdom\living\xhr\XMLHttpRequest-impl.js:655:18)
at Request.emit (events.js:327:22)
at Request.onRequestError (C:\Users\leoniecg\Projects\OneCustomerFrontend\frontend\node_modules\request\request.js:877:8)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:469:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) undefined
I have dotenv installed, it works ok with the NODE_TLS_REJECT_UNAUTHORIZED=0 setting in the development environment, but even if I manage to read process.env settings into the test environment, i.e. I can see it with the console.log when I print it at the very top of a test file, I still get the error. Has anyone had this issue? I've been able to read .env.local file:
//.env.local
NODE_TLS_REJECT_UNAUTHORIZED=0
with the instructions given for example here: Using dotenv with Jest.
NODE_TLS_REJECT_UNAUTHORIZED=0 setting is a popular one to even start having Next.js on the localhost, so I guess someone has already stumbled upon this.
Or maybe I should forget about next-page-tester and use Cypress?

SSL Certificate error: [SSL: CERTIFICATE_VERIFY_FAILED] when using aws client in windows 10

Recently I am gettin an error when, for instance, listing data from Amazon S3:
aws s3 ls
SSL validation failed for https://s3.eu-west-1.amazonaws.com/ [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)
I have noticed that the company I work for has added a ZScaler Client Connector. It seems that this client is causing the error. I wonder if someone could give a hint about how to solve this issue.
Upps It seems that I found the solution myself.
Check this site:
https://www.shellhacks.com/aws-cli-ssl-validation-failed-solved/
I downloaded ZScaler certificate and then pointed from config:
$ cat ~/aws/.config
[default]
ca_bundle = /data/ca-certs/whatevername.pem
I was getting crazy, I hope it helps someone else.
Solved it this way:
Locate certifi bundle (cacert.pem) location python -m certifi
export AWS_CA_BUNDLE="[full path to cacert.pem]" from step 1
verify