Ich muss lokale ssl für mein Projekt für eine OAuth-Implementierung implementieren. Ich habe die Seite xsbt-web-plugin durchgelesen (here). Ich habe den Keystore wie empfohlen here erstellt.SBT - Wie konfiguriert ssl für Jetty lokal ausgeführt?
keytool -genkey -alias localhost -keyalg RSA -keystore localhost.jks -keysize 2048
Ich habe es https Anlegesteg config-Datei, die ich here gefunden zu dienen. Dies ist, wie es aussieht:
<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>
Meine SBT Config wie folgt aussieht:
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"))
Das Problem ist nun der Server eine 404 für jede Anforderung dient:
Auch Es gibt diese Warnung auf der Konsole:
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?
Anlegesteg: 8.1.7/Aufzug: 2.6.2
Bitte beraten. Vielen Dank.
Konfigurieren * jetty.xml * richtig ist ein echter Schmerz. Hier ist, was ich brauchte, um SSL zum Laufen zu bringen: https://github.com/earldouglas/xsbt-web-plugin/blob/master/src/sbt-test/container/jetty-xml-https/etc/jetty.xml – earldouglas