-
Notifications
You must be signed in to change notification settings - Fork 566
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
HTTP Proxy TODOs #7287
HTTP Proxy TODOs #7287
Conversation
2218c03
to
2749bc2
Compare
...webclient/webclient/src/test/java/io/helidon/nima/tests/integration/webclient/HttpProxy.java
Outdated
Show resolved
Hide resolved
...webclient/webclient/src/test/java/io/helidon/nima/tests/integration/webclient/HttpProxy.java
Outdated
Show resolved
Hide resolved
e6bce35
to
1a54714
Compare
I am sniffing how does it work the authentication using Spotify as a client, and it is unsecure. The CONNECT is always HTTP so it is possible to see exactly what is sent in any of the network nodes. The authentication is sent as basic authentication in this way:
Anybody sniffing the network will see that user:password is |
ef79a4f
to
7cbba07
Compare
63d093c
to
0b972bb
Compare
Basic authentication is terrible, but if required, we must support it. |
...t/webclient/src/test/java/io/helidon/nima/tests/integration/webclient/AuthHttpProxyTest.java
Outdated
Show resolved
Hide resolved
.../webclient/src/test/java/io/helidon/nima/tests/integration/webclient/AuthHttpsProxyTest.java
Outdated
Show resolved
Hide resolved
nima/webclient/api/src/main/java/io/helidon/nima/webclient/api/Proxy.java
Show resolved
Hide resolved
nima/webclient/api/src/main/java/io/helidon/nima/webclient/api/Proxy.java
Outdated
Show resolved
Hide resolved
0b972bb
to
7b9b128
Compare
httpProxy.stop(); | ||
} | ||
|
||
AuthHttpProxyTest(WebServer server) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just inject the clients into constructor parameters:
AuthHttpProxyTest(Http1Client http1Client, Http2Client http2Client)
and they will be initialized to the host and port of the server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting:
[ERROR] io.helidon.nima.tests.integration.webclient.AuthHttpProxyTest.testUserPasswordNotCorrect1 Time elapsed: 0 s <<< ERROR!
org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [io.helidon.nima.http2.webclient.Http2Client arg1] in constructor [io.helidon.nima.tests.integration.webclient.AuthHttpProxyTest(io.helidon.nima.webclient.http1.Http1Client,io.helidon.nima.http2.webclient.Http2Client)].
at org.junit.jupiter.engine.execution.ParameterResolutionUtils.resolveParameter(ParameterResolutionUtils.java:120)
at org.junit.jupiter.engine.execution.ParameterResolutionUtils.resolveParameters(ParameterResolutionUtils.java:103)
at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:59)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestClassConstructor(ClassBasedTestDescriptor.java:363)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the http2
testing support as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<dependency>
<groupId>io.helidon.nima.testing.junit5</groupId>
<artifactId>helidon-nima-testing-junit5-http2</artifactId>
<scope>test</scope>
</dependency>
.../webclient/src/test/java/io/helidon/nima/tests/integration/webclient/AuthHttpsProxyTest.java
Outdated
Show resolved
Hide resolved
nima/webclient/api/src/main/java/io/helidon/nima/webclient/api/Proxy.java
Outdated
Show resolved
Hide resolved
nima/webclient/api/src/main/java/io/helidon/nima/webclient/api/Proxy.java
Outdated
Show resolved
Hide resolved
7b9b128
to
13a9592
Compare
7928783
to
1959e82
Compare
Signed-off-by: Jorge Bescos Gascon <[email protected]>
1959e82
to
0cfa846
Compare
Signed-off-by: Jorge Bescos Gascon <[email protected]>
#7143
In my opinion, it makes no sense because the header HOST is mandatory and it contains the remote host:port, but you can try it by yourself configuring a proxy in your browser. For example when you visit youtube you will see the next:
Some proxies could not work properly if the CONNECT is not set correctly.