Hi, Do I have to describe more details on my point? I followed the solution at http://stackoverflow.com/questions/9852056/jetty-proxyservlet-with-ssl-support 1. Create a class which extends from AsyncProxyServlet class. 2. Override createHttpClient() method. The key here is that the HttpClient instance which you will create will need an SslContextFactory(). Just set SslContextFactory with appropriate settings on HttpClient object and you will be good to go.
But it doesn't work. Does Jetty proxy support this scenario? Thanks! On Fri, Apr 8, 2016 at 4:37 PM, Mark Wang <[email protected]> wrote: > Hi, > I'm using Jetty 9.3.5, and take advantage of ProxyServlet as a tunnel > proxy. > Please consider the following test codes, > > ******************************** > SslContextFactory sslContextFactory = new SslContextFactory(); > sslContextFactory.setSslContext(sslContext); > > HttpClient client = new HttpClient(sslContextFactory); > client.getProxyConfiguration().getProxies().add(new HttpProxy(new > Origin.Address(host, port), true)); > client.start(); > > String url = "http://host:port/xxx"; > ContentResponse response = client.newRequest(url).send(); > System.out.println(response.getContentAsString()); > client.stop(); > ******************************** > > If the url is HTTP path, it works well.But if the url is HTTPS path, say, > https://host:sslPort/xxx, it reports 404 error. > The exception shows some message, like > org.eclipse.jetty.client.HttpResponseException: Received > HttpResponse[HTTP/1.1 404 Not Found]@1aed4133 for HttpRequest[CONNECT > host:sslPort HTTP/1.1]@5b1d67b3 > > I have set SSL context for the client. What is missing? > > Thanks! >
_______________________________________________ jetty-users mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jetty-users
