Jetty SSL配置导致107 /(错误代码:ssl_error_rx_record_too_long)

时间:2013-02-22 15:46:50

标签: maven jetty

Jetty 9.0.0.RC0

我在通过maven正确配置我的jetty服务时遇到问题。

目前我有

<plugin>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <configuration>
    <contextHandlers>
        <contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
            <war>../dataProvider/target/dataProvider-${project.version}.war</war>
            <contextPath>/dataProvider</contextPath>
        </contextHandler>
    </contextHandlers>
    <webAppConfig>
        <contextPath>/</contextPath>
        <baseResource
                implementation="org.eclipse.jetty.util.resource.ResourceCollection">
            <resourcesAsCSV>src/main/webapp,src/main/javascript,
                target/closure</resourcesAsCSV>
        </baseResource>
        <defaultsDescriptor>src/main/resources/jetty/webdefault.xml</defaultsDescriptor>
    </webAppConfig>
    <jettyXml>src/main/resources/jetty/jetty.xml</jettyXml>
    </configuration>
</plugin>

在我的pom和

<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="." />src/test/resources/keystore</Set>
        <Set name="KeyStorePassword">password</Set>
        <Set name="KeyManagerPassword">password</Set>
        <Set name="TrustStorePath"><Property name="jetty.home" default="." />src/test/resources/keystore</Set>
        <Set name="TrustStorePassword">password</Set>
    </New>

    <Call name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server"><Ref refid="Server" /></Arg>
                <Arg name="factories">
                    <Array type="org.eclipse.jetty.server.ConnectionFactory">
                        <Item>
                            <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                                <Arg name="config"><Ref refid="httpConfig" /></Arg>
                            </New>
                        </Item>
                    </Array>
                </Arg>
                <Set name="host"><Property name="jetty.host" /></Set>
                <Set name="port"><Property name="jetty.port" default="8080" /></Set>
                <Set name="idleTimeout">30000</Set>
            </New>
        </Arg>
    </Call>

    <Call id="sslConnector" name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server"><Ref refid="Server" /></Arg>
                <Arg name="factories">
                    <Array type="org.eclipse.jetty.server.ConnectionFactory">
                        <Item>
                            <New class="org.eclipse.jetty.server.SslConnectionFactory">
                                <Arg name="next">http/1.1</Arg>
                                <Arg name="sslContextFactory"><Ref refid="sslContextFactory"/></Arg>
                            </New>
                        </Item>
                    </Array>
                </Arg>
                <Set name="host"><Property name="jetty.host" /></Set>
                <Set name="port"><Property name="jetty.tls.port" default="8443" /></Set>
                <Set name="idleTimeout">30000</Set>
            </New>
        </Arg>
    </Call>
</Configure>

在码头。我猜它做了一些疯狂的事情并将https服务暴露为http错误请求并失败,但我不确定为什么。这是非常难以调试所以我很好奇,如果有其他人让它工作?

0 个答案:

没有答案