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

Installing solc behind a proxy fails #3057

Open
2 tasks done
davebryson opened this issue Sep 2, 2022 · 7 comments
Open
2 tasks done

Installing solc behind a proxy fails #3057

davebryson opened this issue Sep 2, 2022 · 7 comments
Labels
A-compiler Area: compiler C-forge Command: forge T-bug Type: bug T-to-reproduce Type: requires reproduction

Comments

@davebryson
Copy link

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

0.2.0

What command(s) is the bug in?

forge build

Operating System

macOS (Apple Silicon)

Describe the bug

Installing solc on a new project fails with invalid peer certificate: UnknownIssuer. I'm pretty sure this is due to the corporate MITM proxy I'm behind. Is there another way to manually install solc as a work around?

@davebryson davebryson added the T-bug Type: bug label Sep 2, 2022
@gakonst gakonst added this to Foundry Sep 2, 2022
@gakonst gakonst moved this to Todo in Foundry Sep 2, 2022
@rkrasiuk rkrasiuk added C-forge Command: forge A-compiler Area: compiler labels Sep 2, 2022
@mattsse
Copy link
Member

mattsse commented Sep 2, 2022

hmm

this may be related https://www.reddit.com/r/rust/comments/vy5bof/rust_with_reqwest_behind_a_local_http_proxy_burp/

we use https://github.com/roynalnaruto/svm-rs/ to install svm

which is its own cli tool

pre-built apple silicon solc builds are fetched from https://github.com/roynalnaruto/solc-builds/tree/fc7263e8b571b6a4c754d443fa4b7b4236b4735f/macosx/aarch64

we check if they're installed like this

~/.svm/0.8.16/solc-0.8.16

~/.svm/0.8.16/solc-0.8.16 --version

solc, the solidity compiler commandline interface
Version: 0.8.16+commit.07a7930e.Darwin.appleclang

@davebryson
Copy link
Author

@mattsse Thanks for the response. Adding the feature native-tls to the reqwest dependency in svm solved the problem. I used svm separately to install a solc version. Forge then worked perfectly

@mattsse
Copy link
Member

mattsse commented Sep 2, 2022

I see, will check if there's a workaround for rustls as well

@jamesmorgan
Copy link

We are also hitting this issue - any ideas on a work around? I assume this is due to corporate machine setup

@mattsse
Copy link
Member

mattsse commented Dec 28, 2022

this seems to be a common issue: denoland/deno#10312

rustls/rustls#731

does installing via svm directly work?

could you share the error output so we can track down where exactly this is thrown?

@davebryson
Copy link
Author

davebryson commented Dec 28, 2022

@mattsse @jamesmorgan I solved the issue by making one small change to SVM and rebuilding locally. Specifically, I changed this line: https://github.com/roynalnaruto/svm-rs/blob/master/Cargo.toml#L41 to:

reqwest = { version = "^0.11.7", default-features = false, features = ["json", "native-tls"] }

and installed SVM separately. Foundary worked without issue after that - even updates.

I no longer have details about the specific error output. But essentially is was related to an SSL CERT error when installing foundary rs, a common issue with MITM corporate proxies

@callum-elvidge
Copy link

I got around this issue by using @davebryson method whilst installing solc however this same error is thrown when trying to deploy a contract using a script and there seems to be no obvious workaround. Will there be native tls support anytime soon?

forge script script/Deploy.s.sol --rpc-url $SEPOLIA_RPC_URL --broadcast --verify -vvvv
Error: 
error sending request for url (https://eth-sepolia.g.alchemy.com/v2/{API_KEY): error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

Context:
- Error #0: error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer
- Error #1: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

@zerosnacks zerosnacks added the T-to-reproduce Type: requires reproduction label Jun 26, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiler Area: compiler C-forge Command: forge T-bug Type: bug T-to-reproduce Type: requires reproduction
Projects
Archived in project
Development

No branches or pull requests

7 participants