简体   繁体   English

不带https方案的带有.key和.cer的HTTP请求

[英]HTTP Request with .key and .cer without https scheme

I am developing a java client where I need to send some soap xml to server. 我正在开发一个Java客户端,我需要在其中发送一些soap xml到服务器。 Server is running on http scheme but it requires request to be encrypted as is there in case of https. 服务器运行在http方案上,但是它要求对请求进行加密,就像使用https一样。 I have generated .cer and .key files on my server and same has been imported on server side as well. 我已经在服务器上生成了.cer和.key文件,并且这些文件也已经在服务器端导入了。 Now when I tries to execute below command to send request to server, it is not working. 现在,当我尝试执行以下命令向服务器发送请求时,它不起作用。

My soap xml is there in text.txt 我的soap xml在text.txt中

curl -vX POST -d @test.txt http://test.com:98/wcflib-tc/service.svc 
--header "Content-Type:application/soap+xml; charset=utf-8;" 
--cert /myserver/certs/server.crt 
--key  /myserver/certs/server.key

* About to connect() to test.com port 98 (#0)    
*   Trying 172.27.655.65... connected
* Connected to test.com (172.27.655.65) port 98 (#0)
> POST /wcflib-tc/service.svc HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.9.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: test.com:98
> Accept: */*
> Content-Type:application/soap+xml; charset=utf-8;
> Content-Length: 962
>

< HTTP/1.1 500 Internal Server Error
< Content-Type: application/soap+xml; charset=utf-8
< Server: Microsoft-IIS/7.0
< X-Powered-By: Programmer's tears
< Date: Mon, 18 Nov 2013 05:26:18 GMT
< Content-Length: 576
<
* Connection #0 to host test.com left intact
* Closing connection #0
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header><a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action></s:Header>       
<s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value> 
<s:Subcode><s:Value xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
a:InvalidSecurity</s:Value></s:Subcode></s:Code>
<s:Reason><s:Text xml:lang="en-US">
An error occurred when verifying security
for the message.</s:Text></s:Reason>

Please let me know the solution. 请让我知道解决方案。 Otherwise let me know how to handle http request with .key and .cer file using any java api. 否则让我知道如何使用任何Java API使用.key和.cer文件处理http请求。

The clue is in http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd - you need to use WS-Security. 线索位于http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd -您需要使用WS-Security。 Bore yourself to tears reading the specs here https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss 在这里阅读规格会让您流泪, 请https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用.cer证书发出HTTPS请求 - Using .cer certificate to make an HTTPS request 需要使用.cer证书执行GET&POST HTTPS请求 - Need to do a GET&POST HTTPS Request using a .cer certificate 将所有HTTP请求重定向到HTTPS请求,而无需更改代码 - Redirect all HTTP request to HTTPS request without code change 将每个HTTP请求重定向到HTTPS - Redirect every HTTP request to HTTPS 毕加索:无法识别的 HTTP 方案请求类型 - Picasso: Unrecognized type of request for HTTP scheme 如何修复“预期的 URL 方案 &#39;http&#39; 或 &#39;https&#39; 但未找到冒号”错误? - How to fix "Expected URL scheme 'http' or 'https' but no colon was found" error? 如何将Restlet附加到特定的URL路径方案(HTTP或HTTPS)? - How to attach a restlet to a partiular URL path scheme (HTTP or HTTPS)? Spring Security SAML,在使用 SAMLContextProviderLB 设置为 HTTPs 方案时重定向到 HTTP 而不是 HTTPS - Spring Security SAML, Redirects going to HTTP instead of HTTPS when using SAMLContextProviderLB set to HTTPs scheme 如何使用Java HTTPS服务器管理HTTP请求? - How to manage HTTP request with Java HTTPS server? 使用 HttpsURLConnection 发出 HTTP 和 HTTPS 请求 - Use HttpsURLConnection to make HTTP and HTTPS request's
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM