gpt4 book ai didi

https - Mule HTTPS 访问

转载 作者:行者123 更新时间:2023-12-04 04:54:19 25 4
gpt4 key购买 nike

要访问我的测试,我使用 http://hostDesired.com/service?WSDL :这是一个直接运行在 Mule 中的常规服务代理。

我如何更改它才能使用 https://hostDesired.com/service?WSDL 进行访问?我尝试过但没有奏效的是:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ssl="http://www.mulesoft.org/schema/mule/ssl" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:https="http://www.mulesoft.org/schema/mule/https"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.4/mule-http.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.4/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/spring-security http://www.mulesoft.org/schema/mule/spring-security/3.4/mule-spring-security.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.mulesoft.org/schema/mule/ssl http://www.mulesoft.org/schema/mule/ssl/current/mule-ssl.xsd" version="EE-3.4.0">

<mule-ss:security-manager>
<mule-ss:delegate-security-provider
name="memory-dao" delegate-ref="authenticationManager" />
</mule-ss:security-manager>

<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="asd" password="asd" authorities="ROLE_ADMIN" />
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
</spring:beans>

<https:connector name="httpsConnector">
<https:tls-key-store path="keystore.jks"
keyPassword="${jks.password}" storePassword="${jks.password}" />
</https:connector>

<pattern:web-service-proxy name="ProxyService"
inboundAddress="https://desiredHost/services/Services/Service"
outboundAddress="http://remoteHost/services/Service.svc"
wsdlLocation="http://remoteHost/services/Service.svc?singleWSDL"/>

</mule>

它没有用……我该怎么做才能把它改成骡子?

基本思想是从客户端到代理服务器添加加密。

最佳答案

当您使用 HTTPS 入站端点时,您需要配置 HTTPS 连接器,以便 Mule 知道在处理请求时使用什么证书。

引用HTTPS连接器的配置页面:http://www.mulesoft.org/documentation/display/current/HTTPS+Transport+Reference

由于文档上的内容非常困惑,让我补充一点,您只需要一个正确配置的 https:tls-key-store https:connector 中的元素,类似于:

<https:connector name="httpsConnector">
<https:tls-key-store path="keystore.jks"
keyPassword="${jks.password}" storePassword="${jks.password}" />
</https:connector>

此示例假定您的 keystore 文件名为 keystore.jks并且在类路径上可用。它还假设您已经声明了 jks.password属性,并且您对 keystore 和 key 使用相同的密码。 适应你自己的情况 .

关于https - Mule HTTPS 访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16990263/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com