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

Default ProxyServlet cannot proxy to https urls #5362

Closed
joakime opened this issue Sep 28, 2020 · 2 comments · Fixed by #5363
Closed

Default ProxyServlet cannot proxy to https urls #5362

joakime opened this issue Sep 28, 2020 · 2 comments · Fixed by #5363
Assignees

Comments

@joakime
Copy link
Contributor

joakime commented Sep 28, 2020

Jetty version
9.4.x

Description
If you have a default proxy setup like this ...

WEB-INF/web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
metadata-complete="false" 
version="3.0">

  <display-name>Transparent Proxy WebApp</display-name>

  <servlet>
    <servlet-name>JavadocTransparentProxy</servlet-name>
    <servlet-class>org.eclipse.jetty.proxy.ProxyServlet$Transparent</servlet-class>
    <init-param>
      <param-name>proxyTo</param-name>
      <param-value>https://www.eclipse.org/jetty/javadoc/</param-value>
    </init-param>
    <init-param>
      <param-name>hostHeader</param-name>
      <param-value>www.eclipse.org</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>

  <servlet-mapping>
    <servlet-name>JavadocTransparentProxy</servlet-name>
    <url-pattern>/current/*</url-pattern>
  </servlet-mapping>

</web-app>

Then the ProxyServlet will fail as the internal HttpClient has no support for SSL/TLS enabled.

@joakime joakime self-assigned this Sep 28, 2020
@joakime
Copy link
Contributor Author

joakime commented Sep 28, 2020

Talked with @sbordet and we'll just enable a default SslContextFactory.Client within AbstractProxyServlet.newHttpClient()

But do we want to introduce a newSslContextClient() method?

joakime added a commit that referenced this issue Sep 28, 2020
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
joakime added a commit that referenced this issue Sep 28, 2020
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
joakime added a commit that referenced this issue Sep 28, 2020
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
joakime added a commit that referenced this issue Sep 28, 2020
+ Better class name.
+ More documentation on purpose of test.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
joakime added a commit that referenced this issue Sep 28, 2020
…5363)

 - ProxyServletTest additions for server backend TLS
 - Updating test-proxy-webapp testing
 - Better class name for test
 - More documentation on purpose of test.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@joakime
Copy link
Contributor Author

joakime commented Sep 29, 2020

PR #5363 merged.

@joakime joakime closed this as completed Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant