Имеется два апп сервера (JBoss), на которых развернуты web службы. Служба с первого сервера
периодически сбрасывает суммарную информацию на второй сервер.
Доступ ко второму серверу защищен посредством SSL
<security-constraint>
<web-resource-collection>
<url-pattern>/center/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
В этом случае первый веб сервер выступает в качестве клиента. И вот тут наступает
Заданы свойства:
URL url1 = Application.class.getResource("/client.keystore");
System.setProperty("javax.net.ssl.keyStore",
Application.class.getResource("/client.keystore").getFile());
System.setProperty("javax.net.ssl.keyStorePassword", "123456");
URL url2 = Application.class.getResource("/client.truststore");
System.setProperty("javax.net.ssl.trustStore",
Application.class.getResource("/client.truststore").getFile());
System.setProperty("javax.net.ssl.trustStorePassword", "123456");
String remoteEndpoint = "https://127.0.0.1:8443/monitoring/center/test";
Сообщение передается посредством SOAPConnection (saaj)
В итоге имеем:
Caused by: java.net.SocketException: Default SSL context init failed: null
at javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:163)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:372)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:282)
Поиск по google ничего вразумительного не дал
Тот же самый код, вызванный из standalone приложения, работает нормально
... << RSDN@Home 1.2.0 alpha rev. 668>>
"Мы будем уничтожать свое ядерное оружие вместе с Америкой" (c) Б. Ельцин