- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
一周以来,我们一直在寻找问题的解决方案,在查看了许多类似的帖子并阅读了所有可用的文档之后,我们还没有找到解决方案。
我将解释一下我目前的情况,希望有人能帮助我们解决问题。
我们在 JAX-WS 中开发了一个 Web 服务客户端,它与另一个平台中的服务器端 Web 服务进行通信。通信是双向 SSL,我们有服务器端的 CA,可以信任他,我们的私有(private)证书可以在服务器端识别。
我们的 Web 服务客户端部署在 Weblogic 10.3 中,当它要调用服务器端 Web 服务时,我们动态加载只加载一个证书的信任库和 keystore ,因为每次我们将使用不同的证书,因此我们不能只使用静态 keystore 。
问题是当我们建立连接、协商握手时,因为 Weblogic 忽略了我们在调用之前加载的信任库和 keystore ,只在 Weblogic 的 keystore 中查找受信任的证书和私钥...
如果我们将受信任的证书放入 Weblogic 的信任库中并重新开始通信。我们开始握手,我们信任服务器端(因为现在 Weblogic 在其 keystore 中找到 CA),但是当我们的 Web 服务客户端必须发送证书以被服务器端信任时,“证书链”是空的并且我们得到一个“BAD_CERTIFICATE”。
我们已经尝试使用 Apache CXF 和 JAX-WS,问题是一样的,使用系统属性和库设置 keystore ...所以我们不知道为什么我们的 Web 服务客户端无法发送证书。 Weblogic 似乎由于某种原因不为它们提供服务,可能是 Weblogic 配置,但我们不知道。
如果有人知道我们能做什么,请告诉我们。
提前致谢。
最佳答案
参见 SSL configuration for WebLogic Server , Configuring Two-Way SSL for a Client Application和 Configure two-way SSL .
keytool -genkey -alias server-alias -keyalg RSA -keypass changeit_0 -storepass changeit_1 -keystore server_keystore.jks -validity 1825
keytool -export -alias server-alias -storepass changeit_1 -file server.cer -keystore server_keystore.jks
keytool -genkey -alias client-alias -keyalg RSA -keypass changeit_2 -storepass changeit_3 -keystore client_keystore.jks -validity 1825
keytool -export -alias client-alias -storepass changeit_3 -file client.cer -keystore client_keystore.jks
#WLHOME\server\lib\cacerts
keytool -import -v -trustcacerts -alias client-alias -file client.cer -keystore cacerts -keypass changeit_2 -storepass changeit
Server->Keystores
Keystores: Custom Identity and Custom Trust
Custom Identity Keystore: server_keystore.jks
Custom Identity Keystore Type: JKS
Custom Identity Keystore Passphrase: changeit_1
Custom Trust Keystore: <WLHOME>\server\lib\cacerts
Custom Trust Keystore Type: JKS
Custom Trust Keystore Passphrase: changeit
Server->General
SSL Listen Port Enabled: true
Server->SSL
Private Key Alias: server-alias
Private Key Passphrase: changeit_0
Hostname Verification: None
Use Server Certs: true
Two Way Client Cert Behavior: Client Certs Requested and Enforced
SSLRejection Logging Enabled: true
1) 服务头。
@WebService
@Policy(uri = "policy:Wssp1.2-2007-Https-ClientCertReq.xml")
2) 客户端处理程序解析器。
package org.ru5.test;
import java.util.*;
import javax.xml.namespace.QName;
import javax.xml.ws.*;
public class MustUnderstandHeadersHandler implements HandlerResolver {
@Override
public List<Handler> getHandlerChain(PortInfo portInfo) {
final List<Handler> handlerList = new ArrayList<Handler>(1);
handlerList.add(new MustUnderstandHeadersSOAPHandler());
return handlerList;
}
private class MustUnderstandHeadersSOAPHandler implements SOAPHandler<SOAPMessageContext> {
private static final String LOCAL_PART = "Security";
private static final String PREFIX = "wsse";
private static final String URI =
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
@Override
public Set<QName> getHeaders() {
final QName securityHeader = new QName(URI, LOCAL_PART, PREFIX);
final Set<QName> headers = new HashSet<QName>();
headers.add(securityHeader);
return headers;
}
@Override
public boolean handleMessage(SOAPMessageContext context) {
return true;
}
@Override
public boolean handleFault(SOAPMessageContext context) {
return true;
}
@Override
public void close(javax.xml.ws.handler.MessageContext context) {
}
}
}
关于ssl - 使用 2 路 SSL 的 Weblogic(10.3) 中的 Web 服务客户端 (JAX-WS) 无法完成握手,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11396259/
我有一个使用 spring-ws 的 web 服务(服务器端)的实现。我想更改我的代码以使用 spring-integration-ws(ws:入站网关和 channel )。我已经尝试过示例,但仍然
我正在尝试使用 JAX-WS (Metro) 开发一个独立的 Java Web 服务客户端,它使用 WS-Security 和用户名 token 身份验证(密码摘要、随机数和时间戳)和时间戳验证以及
我开始使用 JAX WS 研究 Java Web 服务。我正在阅读的书的第一章展示了如何仅使用 java SE 构建和部署简单的 jax ws web 服务。特别是,Web 服务是通过 Endpoin
我尝试在 Netbean 6.8 中使用 ws-import 生成 Java 类。我想重新生成 jax-ws,因为在 ebay.api.paypalapi 包中发现了一个错误(我认为该错误是由于 Pa
我正在为我的项目编写服务器端,它需要 websockets 提供的功能。我一直在寻找并在 npm 中找到了 3 个库。 ws、websocket 和express-ws。您能否解释一下它们之间的区别并
我有一个用于测试 Web 服务的项目,它使用 spring-ws 库。spring-ws 在不久的将来会支持 WS-Reliable Messaging 吗? 最佳答案 作为 Spring-WS 的领
我在 Tomcat 上部署了一个有状态的 Web 服务。它由工厂服务和主要 API 服务组成,并且运行良好。工厂服务向主 API 实例返回一个 W3CEndpointReference,客户端使用该
我构建了一个最小的 Web 服务并使用 javax.xml.ws.Endpoint 发布它。如果我尝试在http://localhost:1234/AddService?wsdl 工作正常。 尝试在
我正在实现一个必须支持 WS-Trust (1.3) 的网络服务。 OASIS 将 WS-Trust 的命名空间定义为 http://docs.oasis-open.org/ws-sx/ws-trus
有没有办法操纵jaxws中使用的编码器。 我喜欢发送一个在网络服务请求中提交的 cdata,为此我想在这里尝试类似描述的东西:http://odedpeer.blogspot.de/2010/07/j
我正在尝试使用 Spring-WS 构建一个简单的 Web 服务客户端,但遇到了麻烦。我试图调用的 SOAP 服务使用 HTTP 基本身份验证以确保安全。 使用 Spring-WS 教程示例,我已经配
我对网络服务很陌生。我找不到 JAX-WS 和 CXF 之间的区别。 据我了解,JAX-WS是java提供的规范,CXF是实现。 如果我错了,请纠正我。 最佳答案 是的,你是对的。 JAX-WS 是基
我有很多用 @WebService(targetNamespace = "mynamespace") 注释的端点.每@WebResult和 @WebParam与 targetNamespace = "
根据网上的文献,我可以看到有两个与Web Services Eventing相关的规范: WS-BaseNotification - 由 OASIS 于 2004 年提交 WS-Eventing -
对于基于 SOAP 的 Web 服务,为什么应该选择 Spring WS 而不是 JAX-WS。我已经阅读了一些文章,甚至 Spring WS 文档功能,但我仍然不清楚。如果我需要说服某人使用 Spr
我使用 wsimport 创建了一个肥皂客户端,我需要将消息中字符串字段内的 xml 数据发送到网络服务器。我知道我实际上并不需要在 Web 服务调用中使用 cdata,但 Web 服务需要此字段位于
我想问一下如何在 JAX-WS 中指定 SOAP Web 服务,这样如果我希望通过值 A 或值B。任何其他值都应该返回错误。 我想到了Java中的枚举,但仍然不知道如何实现它。 有什么建议吗?预先感谢
我用 pyws 实现了一个简单的 Web 服务服务器和 suds . from pyws.server import SoapServer from pyws.functions.register i
我正在 javascript 中使用 websockets 连接到 API 并读取一些数据。 这是代码: function processHUOBIAPI(client,exchange_name,e
我正在使用 Node.js + Express + Express-ws 创建应用程序,但在连接后尝试发送消息时出现以下错误: const fs = require('fs'); con
我是一名优秀的程序员,十分优秀!