Skip to content

Conversation

mirokuratczyk
Copy link

Motivation

Resolve #11907 (comment).

Solution

  • Add --insecure/-k flag to forge script which toggles ignoring invalid certs (e.g., self-signed)

I'm not sure this PR handles all possible codepaths as new providers are built in many different places and each needs to be configured with .accept_invalid_certs(bool).

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Contributor

@mablr mablr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, but I guess it would be actually cleaner to build the provider using :

/// Returns a [RetryProvider] instantiated using [Config]'s
/// RPC
pub fn get_provider(config: &Config) -> Result<RetryProvider> {
get_provider_builder(config)?.build()
}

this would retrieve eth_rpc_accept_invalid_certs key from the config directly.

This actually confirms the need for a refactor of the RpcOpts/EvmArgs common fields. So I'll open a dedicated issue to get feedback from the project team.

#[track_caller]
pub fn get_http_provider(builder: impl AsRef<str>) -> RetryProvider {
try_get_http_provider(builder).unwrap()
pub fn get_http_provider(builder: impl AsRef<str>, accept_invalid_certs: bool) -> RetryProvider {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be there

let Some(endpoint) = ENDPOINT else { return };

let provider = get_http_provider(endpoint);
let provider = get_http_provider(endpoint, false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

feat(forge): add flag to disable HTTPS certificate validation for RPC
2 participants