- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
使用 npm Soap,我尝试对以下端点 var url
进行 SOAP 调用。
var sslRootCAs = require('ssl-root-cas/latest')
sslRootCAs.inject();
var soap = require('soap');
var url = 'https://ws.conf.ebs.health.gov.on.ca:1440/HCVService/HCValidationService?wsdl';
var args = {name: 'value'};
soap.createClient(url, function(err, client) {
if (err) {
console.log(err);
}
else console.log(client);
});
我收到的回调错误为:
{ [Error: unable to verify the first certificate] code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' }
虽然我有证书,但出现上述错误是怎么回事?
我收到以下信息:
单击 WSDL 链接:https://ws.conf.ebs.health.gov.on.ca:1440/HCVService/HCValidationService?wsdl
点击地址栏附近的安全报告图标
点击“查看证书”
安装证书
您需要获取自己的安全证书。对于 IDP 模型,卫生部将接受自签名证书或证书颁发机构颁发的证书。
a) 您将使用证书的私钥签署 HCV 请求;
b) 我们将收到请求并处理它;
c) 我们将发回由我们证书的私钥签名的响应 (go-pki_cacert.arm)。这就是为什么您必须在信任存储中拥有 go-pki_cacert.arm 证书。(另外,之前的电子邮件中提到的其他两个)。
d) 将使用从随请求发送的证书中检索到的公钥对响应中的 key 进行加密。所以,你对应的私有(private)
必须使用 key 来解密它。使用公钥的所有位。然后,您可以使用提供的 key 解密正文/消息内容。
我已提供所有凭据,还需要发送一些示例请求。
下面是示例 XML 请求:
<soapenv:Envelope xmlns:ebs="http://ebs.health.ontario.ca/" xmlns:hcv="http://hcv.health.ontario.ca/" xmlns:idp="http://idp.ebs.health.ontario.ca/" xmlns:msa="http://msa.ebs.health.ontario.ca/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-FF9156B4BEE23716A1142978895556413">MIIGQzC..truncated..CPo=</wsse:BinarySecurityToken>
<ds:Signature Id="SIG-30" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ebs hcv idp msa soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#UsernameToken-26"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ebs hcv idp msa soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>nuqM1lGK6rOVruau3woc66AsvIs=</ds:DigestValue></ds:Reference><ds:Reference URI="#TS-25"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="wsse ebs hcv idp msa soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>YHFurnR786jGnU0dmhB6AuZMWf0=</ds:DigestValue></ds:Reference><ds:Reference URI="#id-27"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="hcv idp msa soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>4HrW5GODU3lE87D24YfwxjGwgCo=</ds:DigestValue></ds:Reference><ds:Reference URI="#id-28"><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ebs hcv msa soapenv" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>mfmdQegqmjMNvXyV0FYGiJwqrwc=</ds:DigestValue></ds:Reference><ds:Reference URI="#id-29">
<ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces PrefixList="ebs hcv idp msa" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>HiE8JaUo37dckfkchYYve9S6LuQ=</ds:DigestValue></ds:Reference></ds:SignedInfo>
<ds:SignatureValue>tAb..truncated..Q==</ds:SignatureValue>
<ds:KeyInfo Id="KI-FF9156B4BEE23716A1142978895556414"><wsse:SecurityTokenReference wsu:Id="STR-FF9156B4BEE23716A1142978895556415">
<wsse:Reference URI="#X509-FF9156B4BEE23716A1142978895556413" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
</wsse:SecurityTokenReference></ds:KeyInfo></ds:Signature>
<wsse:UsernameToken wsu:Id="UsernameToken-26">
<wsse:Username>confsu141@gmail.com</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Your_Password</wsse:Password></wsse:UsernameToken>
<wsu:Timestamp wsu:Id="TS-25"><wsu:Created>2015-04-23T11:35:55Z</wsu:Created>
<wsu:Expires>2015-04-23T11:45:55Z</wsu:Expires></wsu:Timestamp></wsse:Security>
<idp:IDP wsu:Id="id-28" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<ServiceUserMUID>011210</ServiceUserMUID>
</idp:IDP>
<ebs:EBS wsu:Id="id-27" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<SoftwareConformanceKey>b832708a-52a7-45bc-a221-7930267617db</SoftwareConformanceKey>
<AuditId>Your_UniqueAuditID</AuditId>
</ebs:EBS>
</soapenv:Header>
<soapenv:Body wsu:Id="id-29" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<hcv:validate>
<requests>
<hcvRequest>
<healthNumber>1216070563</healthNumber>
<versionCode>ML</versionCode>
<feeServiceCodes>A110</feeServiceCodes>
</hcvRequest>
</requests>
<locale>en</locale>
</hcv:validate>
</soapenv:Body>
</soapenv:Envelope>
我们如何使用 Node.js 来实现这一点?我已经阅读了 SOAP WS-security,但我不知道!在node.js中实现。
最佳答案
安装证书没有帮助,因为它只是将证书保存到操作系统的受信任存储中,但 Node 程序不会从中读取,因此您需要 ssl-root-cas 模块将受信任存储构建到操作系统中内存,以便您的程序可以读取。对于通用 https 请求,您将需要使用 require('ssl-root-cas/latest').inject()
加载受信任存储区拥有的所有证书,但由于您的端点需要特定的证书,您需要手动添加它们:
require('ssl-root-cas')
.addFile('[phyical path to root cert]')
.addFile('[phyical path to chain cert]')
.addFile('[phyical path to signing cert]'); //This one you don't need to read its wsdl.
关于node.js - 使用 X509 证书实现 WSSecurity npm 'Soap',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36968694/
我一直在尝试各种 Java Web 服务堆栈(CXF、Metro 和 Spring-WS),并得出的结论是,它们中没有一个比 Spring 的 SimpleJaxWsServiceExporter 的
我正在尝试用 java 创建一个 Soap 客户端,我必须使用我的私钥对 Soap 消息进行签名。 我正在使用配置了 WS-Security 的 SoapUI 获取响应。 我已经使用 wsimport
我正在尝试为一个 SOAP 服务组装一个小型 CXF 客户端,该服务在其 wsdl 中具有 SignedSupportingTokens ws-security 策略。我已配置CXF客户端如下
我正在尝试使用基于 Java 的 Web 服务,但每次我尝试连接时都会收到这样的错误: org.apache.ws.security.WSSecurityException: The security
问题的第 1 部分: 使用 npm Soap,我尝试对以下端点 var url 进行 SOAP 调用。 var sslRootCAs = require('ssl-root-cas/latest')
我正在尝试请求这项内部服务,负责该服务的团队表示它需要用户名 + 密码并使用证书加密。 我想到使用这个模块node-soap并且我在文档中找到了这个: 1- https://github.com/vp
我尝试从使用 PasswordText WSS 类型的 Web 服务获取信息。首先,我使用 soapUI 对其进行了测试并成功获取了数据。然后我在Java上实现了认证,写了SecurityHandle
最近几天一直在为这个错误而苦苦挣扎 Authentication of type {http://service.soap.xcompany.com}AuthenticationHeader had
我正在使用 jax-ws 从 JAVA 调用使用 WS-Security 的 SOAP 服务。问题是响应包含一些 MustUnderstand header ,并且我收到 Element notund
我正在使用 .net 中开发的 Web 服务,该服务接受用户名和密码作为 SOAP header 的一部分。我创建了 SOAPHandler 来创建 header 。 我打印了如下消息: x
Web 服务托管在没有 Internet 连接的服务器上 我正在使用 SOAPUI 访问 Web 服务 url 并进行测试 但得到以下错误信息任何帮助真的很感激
我浏览了以下链接:SOAPFaultException "MustUnderstand headers (oasis-200401-wss-wssecurity-secext-1.0.xsd) are
我是一名优秀的程序员,十分优秀!