2017-03-13 3 views
0

OAuth実装のために自分のプロジェクトにローカルsslを実装する必要があります。私はxsbt-web-pluginページ(here)を読みました。私はhereとしてアドバイスされたキーストアを作成しました。SBT - ローカルで実行されているJetty用にsslを設定するには?

keytool -genkey -alias localhost -keyalg RSA -keystore localhost.jks -keysize 2048 

hereというJetty設定ファイルを使用してhttpsに対応しています。これは、次のようになります。

<Configure id="Server" class="org.eclipse.jetty.server.Server"> 
    <Call name="addConnector"> 
    <Arg> 
     <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> 
      <Arg> 
       <New class="org.eclipse.jetty.http.ssl.SslContextFactory"> 
        <Set name="keyStore">localhost.jks</Set> 
        <Set name="keyStorePassword">password</Set> 
        <Set name="keyManagerPassword">password</Set> 
        <Set name="trustStore">localhost.jks</Set> 
        <Set name="trustStorePassword">password</Set> 
       </New> 
      </Arg> 
      <Set name="port">8443</Set> 
      <Set name="maxIdleTime">30000</Set> 
     </New> 
    </Arg> 
    </Call> 
</Configure> 

マイSBTの設定は次のようになります。

customConfiguration in container.Configuration := true                           
ssl in container.Configuration := Some("127.0.0.1", 8443, "localhost.jks", "password", "password")              
configurationFiles in container.Configuration := Seq(file("path\\to\\jetty.xml")) 

問題は、サーバーがすべての要求のために404を提供しています今ある:
また
enter image description here

コンソールにこの警告が表示されます:

2017-03-13 16:06:56.819:WARN:oeji.nio:javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack? 

桟橋:8.1.7 /リフト:2.6.2

助言してください。ありがとうございました。

+0

の設定で実行している私のdevのサーバーへの8443からのすべての要求を転送し、ローカルに実行しているだけで、別のサーバーであるSTunnelを使用* jetty.xml *正確に本当の痛みです。 https://github.com/earldouglas/xsbt-web-plugin/blob/master/src/sbt-test/container/jetty-xml-https/etc/jetty.xmlを取得するために私が必要としたことは次のとおりです。 – earldouglas

答えて

0

は数日間これで苦労した後、私は基本的に8080

+0

もう一つのオプションは、ローカルにnginxを置くだけです。 stunnelと同じ考え方、比較的単純な構成。私はいつもそうしています---ボーナスとして、私は別のローカルURLを別のローカルアプリにポイントできます。 –

関連する問題