我需要为我的项目实现本地ssl以实现OAuth。我通读了xsbt-web-plugin页面(here)。我按照建议here创建了密钥库。
@{
if (Model.Customers.Count() > 0)
{
foreach (var customer in Model.Cusomters)
{
<text>ArrayCustomers.push("@(customer.Name)");</text>
}
}
else
{
<text>ArrayCustomers.push("");</text>
}
}
refresh_table();
我使用我发现here的jetty配置文件来运行https。这就是它的样子:
keytool -genkey -alias localhost -keyalg RSA -keystore localhost.jks -keysize 2048
我的SBT配置如下所示:
<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>
此外,控制台上还有此警告:
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"))
Jetty:8.1.7 / Lift:2.6.2
请指教。谢谢。