OAuth 구현을 위해 내 프로젝트에 로컬 ssl을 구현해야합니다. xsbt-web-plugin 페이지 (here)를 읽었습니다. here으로 알려주므로 키 저장소를 만들었습니다. SBT - 로컬에서 실행중인 Jetty에 대해 ssl을 구성하는 방법은 무엇입니까?
keytool -genkey -alias localhost -keyalg RSA -keystore localhost.jks -keysize 2048
은 내가
here을 발견 부두 구성 파일을 사용하여 HTTPS를 제공하기 위해 그것을 얻었다. 또한
:
이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
알려 주시기 바랍니다. 고맙습니다.
구성에서 실행 내 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