2017-01-17 20 views
0

WildFly 8.2.1では、既存のWebサービス(JAX-WS)でSSLを使用しようとしていますが、クイックスタートでSSLを使用していないことがわかりました。 。WebサービスでSSLを使用する

<security-constraint> 
    <display-name>Foo security</display-name> 
    <web-resource-collection> 
     <web-resource-name>FooService</web-resource-name> 
     <url-pattern>/foo/FooService</url-pattern> 
     <http-method>POST</http-method> 
    </web-resource-collection> 
    <user-data-constraint> 
     <transport-guarantee>CONFIDENTIAL</transport-guarantee> 
    </user-data-constraint> 
</security-constraint> 

、これが私のstandalone.xmlである:これまでのところ私は、web.xmlにこれを追加しました

<subsystem xmlns="urn:jboss:domain:webservices:1.2"> 
    <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host> 
    <endpoint-config name="Standard-Endpoint-Config"/> 
    <endpoint-config name="Recording-Endpoint-Config"> 
    <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM"> 
    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/> 
    </pre-handler-chain> 
    </endpoint-config> 
    <client-config name="Standard-Client-Config"/> 
</subsystem> 

どうやらそれは十分ではありません。私はstandalone/data/wsdl/foo.ear/foo.war/FooService/Bar.wsdlに見たとき、私は以下を参照してください。EAR/WARで、soap:address.locationは単にプレースホルダ(私は値が無視されることを想定)で満たされていることを

<service name="FooService"> 
    <port binding="foowsb:FooBinding" name="FooBinding"> 
     <soap:address location="http://localhost:8080/foo/FooService"/> 
    </port> 
</service> 

注意を。

私はセキュリティレルムの設定と、keytool(私がやった)を使って自己署名証明書を作成することについていくつかの情報を見つけました。

wsdl-uri-scheme=httpsも設定しようとしましたが、これはCXFのそれ以降のバージョンでのみサポートされています。今のサービスがhttps://localhost:8443に露出してしまった -

+0

JBossフォーラムへのクロスリンク:https://developer.jboss.org/message/967556#967556 –

答えて

0

は、それが置き換えられていたときにsoap:address.location値はREPLACE_WITH_ACTUAL_URLからhttps://REPLACE_WITH_ACTUAL_URLはトリックをしたことを変更するので、無視されていないようです。

私はstandalone.xmlにしなければならなかった複数のステップのカップルがあります:undertowで、https-listenerを追加します。

<https-listener name="secure" socket-binding="https" security-realm="SslRealm"/> 

はSslRealmを定義します。私は同じキーストアを再利用

<security-realm name="SslRealm"> 
    <server-identities> 
     <ssl> 
     <keystore path="foo.keystore" relative-to="jboss.server.config.dir" keystore-password="foo1234" alias="foo" key-password="foo1234"/> 
     </ssl> 
    </server-identities> 
    <authentication> 
     <truststore path="foo.truststore" relative-to="jboss.server.config.dir" keystore-password="foo1234"/> 
    </authentication> 
</security-realm> 

注意をサーバーとクライアントがここにあります。そして、私のクライアントは、開発中に同じWFノードにATMあり、私はあまりにも、そこにセットアップするクライアント側の部分を持っていたので、:

<system-properties> 
    <property name="javax.net.ssl.trustStore" value="${jboss.server.config.dir}/foo.keystore"/> 
    <property name="javax.net.ssl.trustStorePassword" value="foo1234"/> 
    <property name="org.jboss.security.ignoreHttpsHost" value="true"/> 
</system-properties> 
最後のプロパティは cxf.tls-client.disableCNCheckと9+ WFに交換する必要があります。

関連する問題