2017-03-13 46 views
0

OAuth 구현을 위해 내 프로젝트에 로컬 ssl을 구현해야합니다. xsbt-web-plugin 페이지 (here)를 읽었습니다. here으로 알려주므로 키 저장소를 만들었습니다. SBT - 로컬에서 실행중인 Jetty에 대해 ssl을 구성하는 방법은 무엇입니까?

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

은 내가 here을 발견 부두 구성 파일을 사용하여 HTTPS를 제공하기 위해 그것을 얻었다. 또한

enter image description here

:

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)를 제공한다 :

<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의 설정은 다음과 같습니다이는 모습입니다 콘솔에 다음 경고가 표시됩니다.

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의 * 정확하게 진짜 고통이다. SSL을 작동시키는 데 필요한 것은 다음과 같습니다. 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을 다른 로컬 앱으로 지정할 수있다. –