Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

[474] Add proxy options to http client to use Ethsigner behind proxy #475

Merged
merged 7 commits into from
Nov 23, 2022

Conversation

germinalo
Copy link
Contributor

@germinalo germinalo commented Nov 3, 2022

PR Description

Add configuration to the vertx http client used by Ethsigner to access blockchain node behind a proxy.

Fixed Issue(s)

fixes #474

Documentation

A change in the documentation should be made to use config variables for proxy :
--downstream-http-proxy-host : Hostname for proxy connect, no proxy if null (default: null)
--downstream-http-proxy-port : Port for proxy connect (default: 80)
--downstream-http-proxy-username : Username for proxy connect, no authentication if null (default: null)
--downstream-http-proxy-password : Password for proxy connect, no authentication if null (default: null)

@CLAassistant
Copy link

CLAassistant commented Nov 3, 2022

CLA assistant check
All committers have signed the CLA.


applyTlsOptions(clientOptions, config);
return clientOptions;
}

private static Optional<ProxyOptions> proxyOptions() {
var proxyHost = System.getProperty("http.proxyHost", "none");
var proxyPort = Integer.valueOf(System.getProperty("http.proxyPort", "80"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Integer.valueOf can throw NumberFormatException. catch block can be used to assign default value of 80 to proxy port.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we should be able to cover all the options in ProxyOptions i.e. https://vertx.io/docs/apidocs/io/vertx/core/net/ProxyOptions.html . Specifying only host/port will work for unauthenticated proxy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @usmansaleem, I added two commits to the PR

@siladu siladu added the TeamGroot Identifies a given issue is assigned to the Groot Team label Nov 11, 2022
@siladu siladu removed the TeamGroot Identifies a given issue is assigned to the Groot Team label Nov 21, 2022
@jframe jframe added the doc-change-required Indicates an issue or PR that requires doc to be updated label Nov 23, 2022
Copy link
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for you contribution

@jframe jframe merged commit 33685b5 into Consensys:master Nov 23, 2022
Copy link
Contributor

@usmansaleem usmansaleem left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for taking your time to submit the PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
doc-change-required Indicates an issue or PR that requires doc to be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving Ethsigner to acces node behind a proxy
5 participants