Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在GWT&x27中启用HTTPS;什么是码头?_Gwt_Https_Jetty - Fatal编程技术网

如何在GWT&x27中启用HTTPS;什么是码头?

如何在GWT&x27中启用HTTPS;什么是码头?,gwt,https,jetty,Gwt,Https,Jetty,如何在GWT附带的Jetty中启用HTTPS?GWT-dev.jar中有一个README-SSL.txt“隐藏”。你可以找到最新的版本 特别是,在Jetty的启动参数中添加-server:ssl,以便为localhost使用默认的自签名证书。嗨,我认为这可以帮助一些人,我也使用GWT,我们需要使用HTTPS 基本上,我们使用maven运行gwt,因此命令类似于这样,以启用https gwt:debug -Dgwt.style=PRETTY -Dgwt.server=:ssl 当使用jetty:

如何在GWT附带的Jetty中启用HTTPS?

GWT-dev.jar中有一个README-SSL.txt“隐藏”。你可以找到最新的版本


特别是,在Jetty的启动参数中添加
-server:ssl
,以便为
localhost
使用默认的自签名证书。嗨,我认为这可以帮助一些人,我也使用GWT,我们需要使用HTTPS

基本上,我们使用maven运行gwt,因此命令类似于这样,以启用https

gwt:debug -Dgwt.style=PRETTY -Dgwt.server=:ssl
当使用jetty:runwar或jetty:run运行时,插件的pom.xml部分就是这样的

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <version>6.1.19</version>
    <dependencies>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>oracle-jdbc</groupId>
            <artifactId>ojdbc</artifactId>
            <version>14</version>
        </dependency>
    </dependencies>
    <configuration>
        <webApp>${project.build.directory}/${warName}.war</webApp>
        <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                <port>8080</port>
                <maxIdleTime>60000</maxIdleTime>
            </connector>
            <connector implementation="org.mortbay.jetty.security.SslSocketConnector">
                <port>8443</port>
                <maxIdleTime>60000</maxIdleTime>
                <keystore>${project.build.directory}/jetty-ssl.keystore</keystore>
                <password>jetty6</password>
                <keyPassword>jetty6</keyPassword>
            </connector>
        </connectors>
    </configuration>
</plugin>

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>keytool-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <id>clean</id>
            <goals>
                <goal>clean</goal>
            </goals>
        </execution>
        <execution>
            <phase>generate-resources</phase>
            <id>genkey</id>
            <goals>
                <goal>genkey</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <keystore>${project.build.directory}/jetty-ssl.keystore</keystore>
        <dname>cn=localhost</dname>
        <keypass>jetty6</keypass>
        <storepass>jetty6</storepass>
        <alias>jetty6</alias>
        <keyalg>RSA</keyalg>
    </configuration>
</plugin>

org.mortbay.jetty
maven jetty插件
6.1.19
公用记录
公用记录
1.1
javax.servlet
servlet api
2.5
oracle jdbc
ojdbc
14
${project.build.directory}/${warName}.war
8080
60000
8443
60000
${project.build.directory}/jetty-ssl.keystore
码头6
码头6
org.codehaus.mojo
keytool maven插件
产生资源
清洁的
清洁的
产生资源
根基
根基
${project.build.directory}/jetty-ssl.keystore
cn=localhost
码头6
码头6
码头6
RSA

development server上为什么需要https?我们的项目中有一些安全功能,只能通过SSL访问。因此,我也需要测试这个特性。你解决了吗?知道这个策略是否仍然有效吗?这是我能找到的唯一解决方案,但是如果我使用-server:ssl参数运行GWT,我会得到“无法加载服务器类“””。这似乎很奇怪,没有-server:ssl参数,所有这些都可以正常运行。有关此问题的扩展问题,请参见此处。此README-ssl.txt文件确实帮助我解决了在尝试配置自定义truststore以用于内置服务器(Jetty)而不是本地主机的默认证书时遇到的问题。