[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] Minimalistic SPDY proxy setup using Jetty 9.0.0
|
Hi Arjan,
the versions you're using are perfectly fine. Please keep using the
latest npn jar.
However it seems like that the latest npn jar is not compatible with the
OpenJDK version you use. We'll probably release a new npn jar this
afternoon for you. However if you use oracle's jdk it should work just fine.
Cheers,
Thomas
Am 3/12/13 10:19 PM, schrieb Arjan Peddemors:
The version I used is 9.0.0.v20130308 from
http://download.eclipse.org/jetty/ . I did not use a Github snapshot;
have not build from the source code.
best,
Arjan
On 12 March 2013 22:12, Arjan Peddemors <arjan@xxxxxxxxxx
<mailto:arjan@xxxxxxxxxx>> wrote:
Hey Thomas, thanks for describing the steps in detail.
Yes, you are right, I missed that (should be using HTTPProxyEngine,
*not* SPDYProxyEngine).
Now, I've done as you described. But unfortunately, it still does
not work for me. This is the Jetty output, after I open
https://localhost:8443/ with Chrome:
...
2013-03-12
21:56:13.151:INFO:oejssp.HTTPSPDYProxyServerConnector:main: Started
HTTPSPDYProxyServerConnector@119c149{HTTP/1.1}{0.0.0.0:8080
<http://0.0.0.0:8080>}
2013-03-12
21:56:13.454:INFO:oejssp.HTTPSPDYProxyServerConnector:main: Started
HTTPSPDYProxyServerConnector@52d334{SSL-npn}{0.0.0.0:8443
<http://0.0.0.0:8443>}
2013-03-12 21:56:24.558:WARN:oejut.QueuedThreadPool:qtp10883068-58:
java.lang.NoSuchMethodError:
sun.security.ssl.EngineInputRecord.decrypt(Lsun/security/ssl/CipherBox;Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:957)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:888)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:762)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at
org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:487)
at
org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.fill(NextProtoNegoServerConnection.java:100)
at
org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.onFillable(NextProtoNegoServerConnection.java:68)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:240)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:589)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:520)
at java.lang.Thread.run(Thread.java:722)
2013-03-12 21:56:24.566:WARN:oejut.QueuedThreadPool:qtp10883068-29:
java.lang.NoSuchMethodError:
sun.security.ssl.EngineInputRecord.decrypt(Lsun/security/ssl/CipherBox;Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:957)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:888)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:762)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at
org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.fill(SslConnection.java:487)
at
org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.fill(NextProtoNegoServerConnection.java:100)
at
org.eclipse.jetty.spdy.server.NextProtoNegoServerConnection.onFillable(NextProtoNegoServerConnection.java:68)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:240)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:589)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:520)
at java.lang.Thread.run(Thread.java:722)
I've tried two different npn-boot jars: the most recent one and the
one you used in your steps, but that does not make a difference.
Opening http://localhost:8080/ gives a different error. The same
environment on Windows (7, JDK7, Chrome as client) gives the same
error.
We have been using the same versions right?
On 12 March 2013 09:19, Thomas Becker <tbecker@xxxxxxxxxxx
<mailto:tbecker@xxxxxxxxxxx>> wrote:
Hi Arjan,
that's because you're trying to redirect to an HTTP server with
a SPDYProxyEngine. Instead you've to use an HTTPProxyEngine as
described in the example configuration in the documentation for
proxying to HTTP.
To verify that it works I used the latest jetty-9 distribution
and wrote down the steps for you:
1. cp npn jar to $JETTY_HOME
2. uncomment OPTIONS=spdy and add etc/jetty-spdy-proxy.xml in
start.ini
3. comment jetty-http.xml
4. Copy and Paste the HTTP Proxy config from the documentation:
http://www.eclipse.org/jetty/__documentation/current/spdy-__configuring-proxy.html#spdy-__to-http-example-config
<http://www.eclipse.org/jetty/documentation/current/spdy-configuring-proxy.html#spdy-to-http-example-config>
5. replace IP (127.0.0.1) and port (9090) with www.google.com
<http://www.google.com> and 80
6. start jetty: java
-Xbootclasspath/p:npn-boot-1.__1.0.v20120525.jar -jar start.jar
6. try it, works
As you're proxying to another server outside jetty you can
safely remove the http connector for port 9090 from that config.
Also it's fine if you use --exec and place the npn jar inside
lib as you did.
Cheers,
Thomas
Am 3/11/13 10:34 PM, schrieb Arjan Peddemors:
Hi Thomas, thanks for your reply.
Yes, I have read the SPDY proxy example documentation.
I am using jetty-9.0.0.v20130308 .
This is my start.ini:
--exec
-Xbootclasspath/p:lib/npn-__boot-1.1.2.v20130305.jar
OPTIONS=Server,ext,spdy
etc/jetty.xml
etc/jetty-spdy-proxy.xml
I have not touched the etc/jetty.xml file.
This is in etc/jetty-spdy-proxy.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/__configure_9_0.dtd
<http://www.eclipse.org/jetty/configure_9_0.dtd>">
<Configure id="Server"
class="org.eclipse.jetty.__server.Server">
<New id="sslContextFactory"
class="org.eclipse.jetty.util.__ssl.SslContextFactory">
<Set name="KeyStorePath"><Property name="jetty.home"
default="."
/>/etc/keystore</Set>
<Set
name="KeyStorePassword">OBF:__1vny1zlo1x8e1vnw1vn61x8g1zlu1v__n4</Set>
<Set
name="KeyManagerPassword">OBF:__1u2u1wml1z7s1z7a1wnl1u2g</Set>
<Set name="TrustStorePath"><__Property
name="jetty.home" default="."
/>/etc/keystore</Set>
<Set
name="TrustStorePassword">OBF:__1vny1zlo1x8e1vnw1vn61x8g1zlu1v__n4</Set>
</New>
<New id="tlsHttpConfig"
class="org.eclipse.jetty.__server.HttpConfiguration">
<Arg><Ref refid="httpConfig"/></Arg>
<Call name="addCustomizer">
<Arg><New
class="org.eclipse.jetty.__server.__SecureRequestCustomizer"/></__Arg>
</Call>
</New>
<New id="spdyProxyEngine"
class="org.eclipse.jetty.spdy.__server.proxy.SPDYProxyEngine">
<Arg>
<New
class="org.eclipse.jetty.spdy.__client.SPDYClient$Factory">
<Call name="start"/>
</New>
</Arg>
</New>
<New id="proxyEngineSelector"
class="org.eclipse.jetty.spdy.__server.proxy.__ProxyEngineSelector">
<Call name="putProxyEngine">
<Arg>spdy/3</Arg>
<Arg>
<Ref refid="spdyProxyEngine"/>
</Arg>
</Call>
<Set name="proxyServerInfos">
<Map>
<Entry>
<Item>localhost</Item>
<Item>
<New
class="org.eclipse.jetty.spdy.__server.proxy.__ProxyEngineSelector$__ProxyServerInfo">
<Arg type="String">spdy/3</Arg>
<Arg>127.0.0.1</Arg>
<Arg type="int">7070</Arg>
</New>
</Item>
</Entry>
</Map>
</Set>
</New>
<Call name="addConnector">
<Arg>
<New
class="org.eclipse.jetty.spdy.__server.proxy.__HTTPSPDYProxyServerConnector">
<Arg>
<Ref refid="Server"/>
</Arg>
<Arg>
<Ref refid="proxyEngineSelector"/>
</Arg>
<Set name="Port">8080</Set>
</New>
</Arg>
</Call>
<Call name="addConnector">
<Arg>
<New
class="org.eclipse.jetty.spdy.__server.proxy.__HTTPSPDYProxyServerConnector">
<Arg>
<Ref refid="Server"/>
</Arg>
<Arg>
<Ref refid="sslContextFactory"/>
</Arg>
<Arg>
<Ref refid="proxyEngineSelector"/>
</Arg>
<Set name="Port">8443</Set>
</New>
</Arg>
</Call>
</Configure>
I have not changed the sslContextFactory configuration (is
straight from
the distribution).
Now, to try this out, I am running an HTTP server on the
same machine as
the SPDY proxy, listening on port 7070. The proxy is started
with: java
-jar start.jar. In my chrome browser, on the same machine, I
go to
https://localhost:8443/ . No result in the browser (keeps
loading). No
incoming request for the HTTP server on 7070.
Jetty output at this point:
$ java -jar start.jar
2013-03-11 22:21:29.421:INFO:oejs.Server:__main:
jetty-9.0.0.v20130308
2013-03-11
22:21:29.535:INFO:oejssp.__HTTPSPDYProxyServerConnector:__main:
Started
HTTPSPDYProxyServerConnector@__63a4bb{HTTP/1.1}{0.0.0.0:8080
<http://0.0.0.0:8080>
<http://0.0.0.0:8080>}
2013-03-11
22:21:29.864:INFO:oejssp.__HTTPSPDYProxyServerConnector:__main:
Started
HTTPSPDYProxyServerConnector@__b0a583{SSL-npn}{0.0.0.0:8443
<http://0.0.0.0:8443>
<http://0.0.0.0:8443>}
2013-03-11
22:21:47.162:WARN:oejut.__QueuedThreadPool:qtp16655481-__26:
java.lang.NoSuchMethodError:
sun.security.ssl.__EngineInputRecord.decrypt(__Lsun/security/ssl/CipherBox;__Ljava/nio/ByteBuffer;)Ljava/__nio/ByteBuffer;
at
sun.security.ssl.__SSLEngineImpl.readRecord(__SSLEngineImpl.java:957)
at
sun.security.ssl.__SSLEngineImpl.readNetRecord(__SSLEngineImpl.java:888)
at
sun.security.ssl.__SSLEngineImpl.unwrap(__SSLEngineImpl.java:762)
at javax.net.ssl.SSLEngine.__unwrap(SSLEngine.java:624)
at
org.eclipse.jetty.io.ssl.__SslConnection$__DecryptedEndPoint.fill(__SslConnection.java:487)
at
org.eclipse.jetty.spdy.server.__NextProtoNegoServerConnection.__fill(__NextProtoNegoServerConnection.__java:100)
at
org.eclipse.jetty.spdy.server.__NextProtoNegoServerConnection.__onFillable(__NextProtoNegoServerConnection.__java:68)
at
org.eclipse.jetty.io
<http://org.eclipse.jetty.io>.__AbstractConnection$__ReadCallback.run(__AbstractConnection.java:240)
at
org.eclipse.jetty.util.thread.__QueuedThreadPool.runJob(__QueuedThreadPool.java:589)
at
org.eclipse.jetty.util.thread.__QueuedThreadPool$3.run(__QueuedThreadPool.java:520)
at java.lang.Thread.run(Thread.__java:722)
2013-03-11
22:21:47.162:WARN:oejut.__QueuedThreadPool:qtp16655481-__25:
java.lang.NoSuchMethodError:
sun.security.ssl.__EngineInputRecord.decrypt(__Lsun/security/ssl/CipherBox;__Ljava/nio/ByteBuffer;)Ljava/__nio/ByteBuffer;
at
sun.security.ssl.__SSLEngineImpl.readRecord(__SSLEngineImpl.java:957)
at
sun.security.ssl.__SSLEngineImpl.readNetRecord(__SSLEngineImpl.java:888)
at
sun.security.ssl.__SSLEngineImpl.unwrap(__SSLEngineImpl.java:762)
at javax.net.ssl.SSLEngine.__unwrap(SSLEngine.java:624)
at
org.eclipse.jetty.io.ssl.__SslConnection$__DecryptedEndPoint.fill(__SslConnection.java:487)
at
org.eclipse.jetty.spdy.server.__NextProtoNegoServerConnection.__fill(__NextProtoNegoServerConnection.__java:100)
at
org.eclipse.jetty.spdy.server.__NextProtoNegoServerConnection.__onFillable(__NextProtoNegoServerConnection.__java:68)
at
org.eclipse.jetty.io
<http://org.eclipse.jetty.io>.__AbstractConnection$__ReadCallback.run(__AbstractConnection.java:240)
at
org.eclipse.jetty.util.thread.__QueuedThreadPool.runJob(__QueuedThreadPool.java:589)
at
org.eclipse.jetty.util.thread.__QueuedThreadPool$3.run(__QueuedThreadPool.java:520)
at java.lang.Thread.run(Thread.__java:722)
No active SPDY session when I look at
chrome://net-internals/#__events&q=type:SPDY_SESSION%__20is:active
This is on Ubuntu 12.04
$ java -version
java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7)
(7u15-2.3.7-0ubuntu1~12.04.1)
OpenJDK Server VM (build 23.7-b01, mixed mode)
Any idea?
Best regards,
Arjan
Date: Mon, 11 Mar 2013 09:44:29 +0100
From: Thomas Becker <tbecker@xxxxxxxxxxx
<mailto:tbecker@xxxxxxxxxxx> <mailto:tbecker@xxxxxxxxxxx
<mailto:tbecker@xxxxxxxxxxx>>>
To: jetty-users@xxxxxxxxxxx
<mailto:jetty-users@xxxxxxxxxxx>
<mailto:jetty-users@eclipse.__org
<mailto:jetty-users@xxxxxxxxxxx>>
Subject: Re: [jetty-users] Minimalistic SPDY proxy
setup using Jetty
9.0.0
Message-ID: <513D996D.7060207@xxxxxxxxxxx
<mailto:513D996D.7060207@xxxxxxxxxxx>
<mailto:513D996D.7060207@__intalio.com
<mailto:513D996D.7060207@xxxxxxxxxxx>>>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi Arjan,
you've seen the example configuration for a SPDY to
HTTP proxy in the
documentation?
It's described here:
http://www.eclipse.org/jetty/__documentation/current/spdy-__configuring-proxy.html#spdy-__to-http-example-config
<http://www.eclipse.org/jetty/documentation/current/spdy-configuring-proxy.html#spdy-to-http-example-config>
Regarding your steps:
2. I usually put the npn file in $JETTY_HOME, but
that's just my
personal preference.
3. Comment out jetty-http.xml to disable the HTTP
coonector you
don't need.
4. That depends on what you want to achieve. Read the
documentation:
http://www.eclipse.org/jetty/__documentation/current/spdy-__configuring-proxy.html#spdy-__example-config
<http://www.eclipse.org/jetty/documentation/current/spdy-configuring-proxy.html#spdy-example-config>
and try to apply the settings according to your setup.
5. You need to include the npn jar in the classpath
like so:
-Xbootclasspath/p:$JETTY_HOME/__npn-boot-1.1.2.v20130305.jar
Make sure to change the path to npn-boot if you don't
have it in
$JETTY_HOME.
Cheers,
Thomas
Am 3/10/13 10:49 PM, schrieb Arjan Peddemors:
> Hi all,
> I'm kind of lost setting up a simple Jetty SPDY proxy
configuration on
> my Ubuntu 12.04 machine with OpenJDK 7. I have read
the SPDY
> documentation, but can't seem to get it going.
>
> Say I have a regular (backend) web server running on
the same
machine,
> listening for incoming HTTP request on port 7070. I
want to setup the
> proxy as a frontend such that HTTP over SPDY/3
requests are
forwarded to
> localhost:7070. Given the new Jetty 9.0.0
distribution, what would be
> the *concrete* steps to set this up as simple as
possible?
>
> I would say these are the steps, but what about step
3 and 4?
> 1- Unpack the distribution; cd into it
> 2- Download npn-boot-1.1.2.v20130305.jar from
repo1.maven.org <http://repo1.maven.org>
<http://repo1.maven.org>
> <http://repo1.maven.org>, and copy to the lib directory
> 3- Change the start.ini file: exactly what changes for a
minimalistic setup?
> 4- Change the etc/jetty-spdy-proxy.xml file: exactly
what changes?
> Self-signed certificate is ok.
> 5- Run it with: java -jar start.jar
>
> Thx,
> Arjan
>
>
>
> _________________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
<mailto:jetty-users@xxxxxxxxxxx>
<mailto:jetty-users@eclipse.__org
<mailto:jetty-users@xxxxxxxxxxx>>
>
https://dev.eclipse.org/__mailman/listinfo/jetty-users
<https://dev.eclipse.org/mailman/listinfo/jetty-users>
>
_________________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx <mailto:jetty-users@xxxxxxxxxxx>
https://dev.eclipse.org/__mailman/listinfo/jetty-users
<https://dev.eclipse.org/mailman/listinfo/jetty-users>
_________________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx <mailto:jetty-users@xxxxxxxxxxx>
https://dev.eclipse.org/__mailman/listinfo/jetty-users
<https://dev.eclipse.org/mailman/listinfo/jetty-users>
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users